[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] FreeType incremental glyph loading
From: |
Ken Sharp |
Subject: |
Re: [ft-devel] FreeType incremental glyph loading |
Date: |
Thu, 25 Jan 2018 11:47:42 +0000 |
At 14:31 25/01/2018 +0300, Ann Brednikhina wrote:
Thanks for your quick reply!
But the situation with git clone is absolutely the same. I have cloned
http://git.sv.nongnu.org/r/freetype/freetype2.git
c:\GIT\freetype2>grep -RnP --color=always FT_IncrementalRec .
./include/freetype/ftincrem.h:85: typedef struct
FT_IncrementalRec_* FT_Incremental;
That is all.
Its an opaque object, to be defined by the recipient and used by them.
FreeType doesn't need to know anything about it. If you look at the
comments above the definition there you will see:
/***************************************************************************
*
* @type:
* FT_Incremental
*
* @description:
* An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript interpreters),
* where the glyph data isn't in the font file, or must be overridden by
* different values.
*
* @note:
* It is up to client applications to create and implement @FT_Incremental
* objects, as long as they provide implementations for the methods
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
* and @FT_Incremental_GetGlyphMetricsFunc.
*
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
*
*/
The FT_Incremental_InterfaceRec is defined around line 280 in the same file.
If you want to know how Ghostscript uses it (and as far as I know
Ghostscript is currently the only client that uses incremental font
loading) then you'll need to look at the Ghostscript sources. Ghostscript
is also open source.
Essentially, the client (in our case Ghostscript) adds glyphs to the font,
and tracks them, itself. The methods for retrieving the glyph data and
metrics are supplied by the client. So, when using the incremental
interface, FreeType just requests the data it needs from the client when it
needs either the metrics or outline data. Its up to the client how to store
the data, and how to make it available to FreeType, FT doesn't need to care.
Ken