[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Generating Windows text metrics
From: |
Huw Davies |
Subject: |
Re: [ft-devel] Generating Windows text metrics |
Date: |
Wed, 23 Jan 2013 09:23:05 +0000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Jan 22, 2013 at 04:03:20PM +0000, Tony Smith wrote:
>
> In the Windows API function ::CreateFont the height can be passed in two ways.
> A negative height gives metrics for fit to character height and a positive
> heights means fit to cell height.
> Here is the MSDN page for some more details.
> http://msdn.microsoft.com/en-gb/library/windows/desktop/
> dd183499%28v=vs.85%29.aspx
>
> Can Freetype also generate text metrics for both fit to character height and
> fit to cell height?
Have a look at how it's done in Wine (www.winehq.org)
load_VDMX is used if the font has a VDMX table:
http://source.winehq.org/source/dlls/gdi32/freetype.c#L4212
otherwise the fallback calc_ppem_for_height:
http://source.winehq.org/source/dlls/gdi32/freetype.c#L3919
Elsewhere in that file you'll find how the rest of the metrics are
calculated.
Huw.