(try 2) gdi32: if a font substitution is given then only match tothat substitution not to the original family name.

Aric Stewart aric at codeweavers.com
Fri Oct 10 13:08:31 CDT 2008


You are mostly correct. It looks like windows totally ignores the font 
substitute if it finds the correct font. So this patch is incorrect.

Is there a good mechanic to get wine to force a substitution for a 
broken font? If the user has FontX  however their FontX does not render 
correctly with freetype so we want to replace it with FontY...

-aric

Dmitry Timoshkov wrote:
> "Aric Stewart" <aric at codeweavers.com> wrote:
> 
>> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
>> index 145be9b..c427694 100644
>> --- a/dlls/gdi32/freetype.c
>> +++ b/dlls/gdi32/freetype.c
>> @@ -3408,8 +3408,8 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT 
>> hfont)
>>  */
>>         LIST_FOR_EACH(family_elem_ptr, &font_list) {
>>             family = LIST_ENTRY(family_elem_ptr, Family, entry);
>> -            if (!strcmpiW(family->FamilyName, FaceName) ||
>> -                (psub && !strcmpiW(family->FamilyName, psub->to.name)))
>> +            if (( psub && !strcmpiW(family->FamilyName, 
>> psub->to.name)) ||
>> +                (!psub && !strcmpiW(family->FamilyName, FaceName)))
>>             {
>>                 LIST_FOR_EACH(face_elem_ptr, &family->faces) { 
>>                     face = LIST_ENTRY(face_elem_ptr, Face, entry);
> 
> After loking at this change once more I think it's not correct. It will
> lead to failures to find a font if there is a substitution but a face
> specified by substitution doesn't exist. I'd suggest to test what Windows
> does in that case, and if Windows allows to substitute existing faces
> at all. Do you have a test cases which passes with your patch but doesn't
> without it?
> 



More information about the wine-devel mailing list