[PATCH v2 7/7] gdi32: Improve the determine code whether the chracter is the fullwidth.

Byeongsik Jeon bsjeon at hanmail.net
Fri Feb 1 14:11:58 CST 2019


Byeongsik Jeon wrote:
> Akihiro Sagawa wrote:
>>
>>
>> In my opinion, why don't we test the following condition for fixed_pitch_full?
>> fixed_pitch_full = avg_advance > 0
>>     && (base_advance + 63) >> 6
>>         >= pFT_MulFix(MulDiv(incoming_font->ntmAvgWidth, x, y), em_scale);
>> The x and y are heuristic ratio. I think they will be 1.5~1.8.
>>
>> Because base_advance can be based on linked font, i.e. another font
>> replaced by get_glyph_index_linked(), the glyph might be a proportional
>> typeface. In that case, "(base_advance + 63) >> 6 != avg_advance" is
>> very loose restriction. A narrow character may be treated as a
>> Full-width character in that case.
>>
>> Regards,
>> Akihiro Sagawa
>>
>>
> Yes. It's absolutely correct.
> 
I looked at the behavior on Windows with a test font that manipulated
the OS/2 table(Panose, AvgCharWidth). It didn't work as I thought. IMO,
Windows seems to be doing something related to the following document.
Surprisingly, Wine already has the scripts needed for conversion, so I
can work easily.

https://www.unicode.org/Public/11.0/udd/EasasianWidth.txt

This is a temporary patch. Please review if possible. It is also good to
post more improved patch directly.

Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdi32-Improve-the-determine-code-whether-the-chracte.patch
Type: text/x-patch
Size: 30199 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190202/aa38a7d9/attachment-0001.bin>


More information about the wine-devel mailing list