gdi32: pOS2->xAvgCharWidth can be negative however tmAvgCharWidth needs a positive value

Aric Stewart aric at codeweavers.com
Tue Feb 21 08:59:32 CST 2012


On 2/21/12 9:39 AM, Dmitry Timoshkov wrote:
> Aric Stewart<aric at codeweavers.com>  wrote:
>
>> Windows response appears to not allow the user to install the fonts at
>> all.  It reports any of the fonts I have which have negative OS/2
>> xAveCharWidth as invalid fonts when I try to install them.
>>
>> This blocks out a few of the main Mac UI fonts.
>>
>> -aric
>>
>> On 2/20/12 10:49 PM, Dmitry Timoshkov wrote:
>>> Aric Stewart<aric at codeweavers.com>   wrote:
>>>
>>>> -    TM.tmAveCharWidth = (pFT_MulFix(pOS2->xAvgCharWidth, x_scale) + 32)>>   6;
>>>> +    TM.tmAveCharWidth = (pFT_MulFix(abs(pOS2->xAvgCharWidth), x_scale) + 32)>>   6;
>>>
>>> Did you test what Windows does in that case?
>
> So, what Mac does in that case? Why do you think that your fix is correct?
>

The mac handles the fonts without issue. The issue appears to be that 
the windows tmAveCharWidth should never be negative, and yet this logic 
causes it to be so for these fonts. If we want to be able to support 
these fonts, which work in every other regard, we need to have a fix 
like this.

-aric



More information about the wine-devel mailing list