Bug 41556 - VIEWING: Incomplete font substitution when FontConfig matches italic font
Summary: VIEWING: Incomplete font substitution when FontConfig matches italic font
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 06:13 UTC by Maxim Iorsh
Modified: 2011-12-24 11:13 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Windows look, using "Guttman Adii" Regular (6.00 KB, image/png)
2011-10-07 06:19 UTC, Maxim Iorsh
Details
Current behavior on Linux - missing font substituted by "David CLM Regular" (27.79 KB, image/png)
2011-10-07 06:21 UTC, Maxim Iorsh
Details
Expected behavior on Linux - missing font substituted by "David CLM Italic" (23.57 KB, image/png)
2011-10-07 07:57 UTC, Maxim Iorsh
Details
FontConfig config file (9.16 KB, text/plain)
2011-10-07 07:59 UTC, Maxim Iorsh
Details
MS Word document - test case (19.50 KB, application/msword)
2011-10-19 04:12 UTC, Maxim Iorsh
Details
Incomplete patch, worked for OOo (1.92 KB, patch)
2011-10-19 04:26 UTC, Maxim Iorsh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Iorsh 2011-10-07 06:13:30 UTC
Problem description: 
When fontconfig matches italic font, italicity is ignored. In the particular
case (Hebrew) a Windows font "Guttman Adii" should be replaced by "David CLM
Italic", but it is replaced by "David CLM" instead.

Current behavior: see attachment

Expected behavior: see attachment
Comment 1 Maxim Iorsh 2011-10-07 06:19:33 UTC
Created attachment 52083 [details]
Windows look, using "Guttman Adii" Regular

"Guttman Adii" is used in Windows to create a doc file
Comment 2 Maxim Iorsh 2011-10-07 06:21:00 UTC
Created attachment 52084 [details]
Current behavior on Linux - missing font substituted by "David CLM Regular"
Comment 3 Maxim Iorsh 2011-10-07 07:57:58 UTC
Created attachment 52086 [details]
Expected behavior on Linux - missing font substituted by "David CLM Italic"
Comment 4 Maxim Iorsh 2011-10-07 07:59:15 UTC
Created attachment 52087 [details]
FontConfig config file

The section
        <match target="pattern" >
                <test name="family" >
                        <string>Guttman Adii</string>
                </test>
                <edit mode="append" binding="same" name="family" >
                        <string>David CLM</string>
                </edit>
                <edit mode="assign" binding="same" name="slant" >
                        <const>italic</const>
                </edit>
        </match>
instructs to replace "Guttman Adii" with "David CLM Italic"
Comment 5 Maxim Iorsh 2011-10-19 04:12:00 UTC
Created attachment 52525 [details]
MS Word document - test case
Comment 6 Maxim Iorsh 2011-10-19 04:23:07 UTC
It seems there is a regression since LibO 3.3.1:
In the trunk the test file is opened with first word in David font, and the second in Times New Roman font.
In LibO 3.3.1 the test file is entirely set in David.
Comment 7 Maxim Iorsh 2011-10-19 04:26:57 UTC
Created attachment 52526 [details]
Incomplete patch, worked for OOo

This patch fixed the same issue in Open Office, but didn't cure LibO. Maybe the mentioned regression is related to this.
Comment 8 Caolán McNamara 2011-10-19 07:37:41 UTC
Looks likes its a cache, which doesn't know about the possibility of an italic/bold variant being the sub, which causes this not to work.
Comment 9 Caolán McNamara 2011-10-19 08:15:08 UTC
http://cgit.freedesktop.org/libreoffice/core/commit/?id=3f9a28f1f704967446b411b3b7e176deeb78ca83 for the font sub problem

The other .doc issue looks like a .doc import bug, might have a look at that too
Comment 10 Caolán McNamara 2011-10-20 02:37:44 UTC
and http://cgit.freedesktop.org/libreoffice/core/commit/?id=625a032f820234b0d55e44b2263c5847993dcc7d fixes the font in the .doc import again.

Looks good now I think
Comment 11 Maxim Iorsh 2011-10-21 07:45:42 UTC
I checked in master, it works fine now. Thanks!
Comment 12 Lior Kaplan 2011-12-24 11:13:24 UTC
Verified in 3.5.0 Beta2.