Bug 53278 - Draw instead of russian show obscure characters in CDR file (Corel Draw 12 format)
Summary: Draw instead of russian show obscure characters in CDR file (Corel Draw 12 fo...
Status: RESOLVED FIXED
Alias: None
Product: Document Liberation Project
Classification: Unclassified
Component: libcdr (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 06:38 UTC by Timon
Modified: 2017-10-30 11:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example CDR file (51.35 KB, application/vnd.corel-draw)
2012-08-09 06:38 UTC, Timon
Details
Another example CDR file (with Arial CYR font) (23.69 KB, application/vnd.corel-draw)
2012-08-09 06:59 UTC, Timon
Details
.ttf - font "GOST type A", .jpg - how file is opened in Corel Draw (856.66 KB, application/x-zip-compressed)
2013-03-20 14:13 UTC, Timon
Details
cdr file with "Gost type A" TTF (75.84 KB, application/vnd.corel-draw)
2013-03-20 14:48 UTC, Timon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timon 2012-08-09 06:38:27 UTC
Created attachment 65325 [details]
Example CDR file

LibreOffice 3.6.0.4 (Final) Russian UI/Locale
Build-ID: 932b512
on Russian Windows XP Professional SP3 (32bit)

Draw opens CDR file (Corel Draw 12 format), but instead of russian we
see obscure characters. Changing font does not correct the situation. It is
impossible to read text.
Comment 1 Timon 2012-08-09 06:50:59 UTC
As far as I see if font in its name contains "CYR" (for example "Arial CYR"), then we see obscure characters and changing font name does not change situation. If font name is "Arial" then all right
Comment 2 Timon 2012-08-09 06:59:57 UTC
Created attachment 65328 [details]
Another example CDR file (with Arial CYR font)
Comment 3 Urmas 2012-08-10 02:19:25 UTC
Maybe another victim of "Foobar CYR,ANSI_CHARSET"="Foobar,ANSI_CHARSET" instead of "Foobar,RUSSIAN_CHARSET"?
Comment 4 Valek Filippov 2012-09-08 13:48:56 UTC
Both files are version 9, not 12.
"Example_12" has "Arial CYR" with properly set encoding, but text uses "Arial" with encoding "0" (ANSI).
"Example_13" has "Arial CYR" with encoding set to "0".

Fridrich, "Example_13" also has embedded spreadsheet in "ole " chunk.
Comment 5 Urmas 2012-09-09 02:48:06 UTC
It is OK to have Arial CYR or Arial CE fonts with charset 0.
Comment 6 Valek Filippov 2012-09-09 13:17:15 UTC
(In reply to comment #5)
> It is OK to have Arial CYR or Arial CE fonts with charset 0.

It's OK to handle text with encoding 0 as ANSI.
Comment 7 Hashem Masoud 2012-10-20 14:02:38 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > It is OK to have Arial CYR or Arial CE fonts with charset 0.
> 
> It's OK to handle text with encoding 0 as ANSI.

So is this bug confirmed?
Comment 8 Timon 2012-10-20 16:30:55 UTC
As far as I can see from discussion, Valek Filippov confirmed this bug, cause he has the same problem with fonts and made suggestion how to fix problem
Comment 9 Urmas 2012-10-23 01:29:27 UTC
> It's OK to handle text with encoding 0 as ANSI.

That is a grave error. An interpretation of LOGFONT::lfCharSet member as a 'codepage' of some kind is the Windows 95 idea which wasn't implemented by anybody but Microsoft. In Windows 3.1 for Western market there was no 204 & co. charsets.

The codepage for fonts generated by software designed for Windows 3.1 should be done by font-by-font basis.
Comment 10 Timon 2013-03-20 10:26:44 UTC
Works fine for me in LibreOffice Version 4.0.2.1 (Build ID: 7e5467ff8f30d821f4fbf69cb2769163eb64c2c) on Russian Windows XP Professional SP3 (32bit)
Comment 11 Timon 2013-03-20 14:13:46 UTC
Created attachment 76816 [details]
.ttf - font "GOST type A", .jpg - how file is opened in Corel Draw

File with problems, that might be related

Despite the fact that TTF font "GOST type A" is installed in system, and in Corel Draw .cdr is opened in a right way with russian characters, in LibreOffice Draw Version 4.0.2.1 (Build ID: 7e5467ff8f30d821f4fbf69cb2769163eb64c2c) instead of russian we see only obscure characters. Changing font does not correct situation. It is impossible to read text.
Comment 12 Fridrich Strba 2013-03-20 14:31:42 UTC
Any chance you could help in doing 8-bit encoding -> unicode tables for the specific font. If that is done, I can try to integrate to libcdr, but don't feel like extracting the information form ttf file myself, sorry.
Comment 13 Fridrich Strba 2013-03-20 14:32:37 UTC
Also, having a CDR file with it would be good. I cannot test easily without it.
Comment 14 Timon 2013-03-20 14:48:22 UTC
Created attachment 76820 [details]
cdr file with "Gost type A" TTF

Sorry, forgot to attach problem .cdr file
Comment 15 Fridrich Strba 2013-03-20 15:18:18 UTC
OK, I committed to libcdr git master a partial fix for the GOST Type A font. The problem that is preventing a complete fix is that this font does not correspond to any ICU table. If I assume that it is having encoding 0xcc, it gives reasonable results apart some Greek mathematical characters that are not correctly converted. I would not mind to handle each font with specific conversion table, but I fear that it does not scale well.
Comment 16 Urmas 2013-03-20 21:34:26 UTC
The "GOST Type A" font doesn't contain any Greek characters. The only ones special are ∾ instead of ˆ and × instead of •. The former is not encoded anywhere in Cyrillic subset for some reason.
Comment 17 Lior Kaplan 2013-04-18 14:15:07 UTC
Notice this commit (also backported to 4-0 branch):
> Fridrich Å trba committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=29339357cfba19e80c3687639fe33e847d3e6f93
> 
> Uploading libcdr-0.0.12: fixing fdo#62538 and fdo#53278
Comment 18 Timon 2013-04-19 07:25:38 UTC
In LibreOffice Version 4.0.3.1 (Build ID: a67943cd4d125208f4ea7fa29439551825cfb39) problem with "GOST Type A" font was fixed (all is in Russian).
But file content is shown not correctly (no curves on the left side, some texts are in wrong places, some arrows are shown as simple lines, ...) compared with Example 28.jpg from attachment 76816 [details] (how file is shown in Corel Draw). If there is need, I can create separate bug with all described problems.
Comment 19 QA Administrators 2015-04-19 03:21:53 UTC Comment hidden (obsolete)
Comment 20 Timon 2015-04-20 06:17:28 UTC
Seems that problem with font was fixed (all texts are shown in Russian, no more obscure characters) in LibreOffice 4.4.2.2 Build ID c4c7d32d0d49397cad38d62472b0bc8acff48dd6 Locale ru_RU on Windows XP Professional SP3 (32bit)

But as I already reported, file content (Example 28) is shown not correctly (no curves on the left side, some texts are in wrong places, some arrows are shown as simple lines, ...). Try to compare Example 28.cdr with screenshot Example 28.jpg (how it is shown in Corel Draw). If there is a need, I can create a separate bug with all described problems.
Comment 21 David Tardon 2015-04-20 06:29:02 UTC
(In reply to Timon from comment #20)
> But as I already reported, file content (Example 28) is shown not correctly
> (no curves on the left side, some texts are in wrong places, some arrows are
> shown as simple lines, ...). Try to compare Example 28.cdr with screenshot
> Example 28.jpg (how it is shown in Corel Draw). If there is a need, I can
> create a separate bug with all described problems.

That would be great.