[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Freetype] TrueType Font implementation query
From: |
Sam Chapman |
Subject: |
RE: [Freetype] TrueType Font implementation query |
Date: |
Tue, 22 May 2001 09:40:02 +0100 |
I think you missed my actual confusion,
where is the number of flags stored?
and what exactly are the instructions for?
(this is what I can't find in the TTF spec)
Sorry to be dumb,
Sam
-----Original Message-----
From: Just van Rossum [mailto:address@hidden
Sent: 22 May 2001 09:25
To: Sam Chapman
Cc: address@hidden
Subject: Re: [Freetype] TrueType Font implementation query
Sam Chapman wrote:
> I'm somewhat confused by the documentation of the TrueTypeFont 'glyf'
table.
> If anyone out there can help clear up my lack of understanding it would be
> appreciated.
>
> THE PROBLEM
>
> The glyf table headers, (offset by the 'loca' table), are clear enough the
> confusion I have is with the Glyph description.
>
> Simple cases are defined as so.
>
> Type Name
> USHORT endPtsOfContours[n] n is the number of contours.
> USHORT instructionLength
> BYTE instructions[n] n is the number of
> instructions.
> BYTE flags[n] n is the number of flags.
> BYTE or SHORT xCoordinates[ ]
> BYTE or SHORT yCoordinates[ ]
>
> Knowing the number of contours it is possible to size and extract the
first
> and second components. This then allows the instructions themselves to be
> loaded. The number of flags is currently unknown to me (so where do I get
> this value?). Also I'm unsure of how the instructions are used as the
flags
> and co-ords clearly contain the contour info. This is either omitted or
> obscure within the truetype spec.
The ms tt/ot spec says this about the flags (from
http://www.microsoft.com/typography/otspec/glyf.htm):
"Array of flags for each coordinate in outline"
So there is one set of flags per coordinate. However, that is not the same
as
how many bytes the flags array is long, since flags can be repeated. You
have to
interpret the flags in order to extract the coordinates.
For example code, look at, erm, FreeType ;-).
Just