[PATCH 2/5] dwrite: Use OS/2 table data to set font style, make it preferable

Dmitry Timoshkov dmitry at baikal.ru
Mon Aug 10 06:40:29 CDT 2015


Nikolay Sivov <bunglehead at gmail.com> wrote:

> On 10.08.2015 14:23, Dmitry Timoshkov wrote:
> > Nikolay Sivov <nsivov at codeweavers.com> wrote:
> >
> >>       if (tt_os2) {
> >> +        USHORT version = GET_BE_WORD(tt_os2->version);
> >> +        USHORT fsSelection = GET_BE_WORD(tt_os2->fsSelection);
> >> +
> >>           if (GET_BE_WORD(tt_os2->usWidthClass) <= DWRITE_FONT_STRETCH_ULTRA_EXPANDED)
> >>               props->stretch = GET_BE_WORD(tt_os2->usWidthClass);
> >>
> >>           props->weight = GET_BE_WORD(tt_os2->usWeightClass);
> >> +        if (version >= 4 && (fsSelection & OS2_FSSELECTION_OBLIQUE))
> >> +            props->style = DWRITE_FONT_STYLE_OBLIQUE;
> >> +        else if (fsSelection & OS2_FSSELECTION_ITALIC)
> >> +            props->style = DWRITE_FONT_STYLE_ITALIC;
> >
> > It's much better to use freetype flags for bold and italic, that way styles
> > will match between gdi32 and dwrite. Besides I'd prefer to trust freetype
> > instead of some handmade code which was not tested by thousands of fonts
> > out there.
> >
> 
> I don't think so, no. And it doesn't have to match gdi32 in that regard.

Why do you think that your handcrafted code is better than the one in freetype,
which has been proven to work for thousands fonts, and why do you think that
dwrite doesn't need to match gdi32 behaviour, do you have a test/prove for that?

-- 
Dmitry.



More information about the wine-devel mailing list