freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] windows font related data types


From: Antoine Leca
Subject: Re: [Devel] windows font related data types
Date: Wed, 17 Oct 2001 11:21:04 +0200

Robb Hill wrote:
> 
> Does anyone on the list have any information on how the data types
> associated with the information that can be retrieved by the
> "EnumFontFamilies" API function in Windows relate to the typeface?

For this kind of informations, you should first look at MSDN,
<URL:http://msdn.microsoft.com>

> My issue is this, "EnumFontFamilies" returns a LOGFONT and a NEWTEXTMETRIC.

Hmmm, my documentation (which is somewhat dated, since I did not check
the online version, but I highly doubt it is wrong) says that
EnumFontFamilies does not return anything, but rather that you should pass
it a callback address; this callback is called several times, each time
for a different "available" font; the arguments passed to this callback
do include (for a TT font) a xxxLOGFONT and a xxxTEXTMETRIC structure
(the real types varies from one version of Windows SDK to another; the real
implementation does not, however, with the continuous addition of features
did enhance the structures).
MSDN further adds:

<QUOTE>
        lpnlf
        Points to a NEWLOGFONT structure that contains information about
        the logical attributes of the font.
[...]
        lpntm
        Points to a NEWTEXTMETRIC structure that contains information about
        the physical attributes of the font.
</QUOTE>

Looks like quite clear to me that we are presented two informations that
are more or less redundants, but do have two differents paths.

TEXTMETRICS are the informations as described in the font file; you should
be able to easily map them from the raw datas.

OTOH, LOGFONT is the way Windows do represent a font. It is much like a
FT_Face in Freetype. But since Windows model is a bit more distant than
Freetype (part of this comles because at the beginning, Windows was a
bitmap-
only scheme), some of the members are calculated by Windows, from the
members in TEXTMETRICS, in order to fit the graphical model.


> So maybe my question is, how do these values actually map to the properties
> of a typeface or is something wrong here?

This is quite a general question, to which the answer is a bit long to my
taste to fit in this e-mail. This subject is covered in long in the
different
books about Windows internals (any good one which covers Windows 3.1 or up
will fit the picture, the scheme did not evolve since 1992).

If you have precise questions over some members, preferably with examples,
we probably would be able to further comment.


Antoine

Attachment: antoineleca.vcf
Description: Targeta per a Antoine Leca


reply via email to

[Prev in Thread] Current Thread [Next in Thread]