[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 07:22:33 CDT 2015


Nikolay Sivov <bunglehead at gmail.com> wrote:

> >>> 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?
> >
> 
> This article should answer your questions 
> http://blogs.msdn.com/b/text/archive/2009/04/15/introducing-the-directwrite-font-system.aspx, 
> and it described logic that I'm going to use. Also keep in mind that 
> dwrite doesn't support Type1 and FON (vector and bitmap), it only works 
> with TTF/OTF and TTC collections of those; another thing is that there's 
> much more to it than reading a couple of table fields to determine final 
> font properties, that has to be handcrafted too. So using freetype for 
> getting a couple of flags seems like too much, not to mention that it 
> won't necessary match what we need either, I'd rather stick to 
> documentation of how this is supposed to work.

That's pretty strange that you are arguing to use some MSDN blog instead
of writing a test case which you usually ask from everybody else. dwrite
already uses freetype for font loading, so avoiding using face flags
provided by freetype doesn't buy you anything. I'd suggest to start using
the information provided by freetype and used by gdi32, and once you have
a problematic font investigate how Windows behaves in that case and act
appropriately.

-- 
Dmitry.



More information about the wine-devel mailing list