AddType3Glyph
Fonts, Type 3 fonts
Description
Adds or replaces one byte-coded glyph and rebuilds the font encoding, widths, and Unicode extraction map
Syntax
Delphi
Function TPDFlib.AddType3Glyph(FontID, CharCode: Integer; Const GlyphName, UnicodeText: WideString; WidthX, WidthY, LLX, LLY, URX, URY: Double; Const Content: AnsiString): Integer;ActiveX
Function PDFlib::AddType3Glyph(FontID As Long, CharCode As Long, GlyphName As String, UnicodeText As String, WidthX As Double, WidthY As Double, LLX As Double, LLY As Double, URX As Double, URY As Double, Content As String) As LongDLL
int DLAddType3Glyph(int InstanceID, int FontID, int CharCode, const wchar_t* GlyphName, const wchar_t* UnicodeText, double WidthX, double WidthY, double LLX, double LLY, double URX, double URY, const char* Content);
int DLAddType3GlyphA(int InstanceID, int FontID, int CharCode, const char* GlyphName, const char* UnicodeText, double WidthX, double WidthY, double LLX, double LLY, double URX, double URY, const char* Content);Parameters
| FontID | Handle of a Type 3 font created by AddType3Font or BeginFont |
|---|---|
| CharCode | Byte code from 0 through 255 that the glyph is bound to |
| GlyphName | Unique glyph name in the font; a leading slash is ignored, the name must not be empty, code 0 requires .notdef and any other code must not use it |
| UnicodeText | Text-extraction mapping; an empty value is inferred from a uniXXXX name, a single printable character name, space, or a printable character code |
| WidthX | Horizontal glyph displacement in glyph space; 0 for upright glyphs |
| WidthY | Vertical glyph displacement in glyph space; 0 for upright glyphs |
| LLX | Left edge of the glyph bounding box in glyph space |
| LLY | Bottom edge of the glyph bounding box in glyph space |
| URX | Right edge of the glyph bounding box; it must be greater than or equal to LLX |
| URY | Top edge of the glyph bounding box; it must be greater than or equal to LLY |
| Content | PDF graphics operators of the glyph program without d0 or d1; the library writes the required metrics first |
Return values
| 1 | The glyph stream and derived font tables were updated |
|---|---|
| 0 | The font, code, box, reserved name, or duplicate glyph name is invalid |
Remarks
The library writes the required d1 metrics first and isolates the supplied program in balanced q and Q operators. Replacing an existing character code keeps the font handle stable. Only fonts returned by AddType3Font are mutable; Type 3 fonts discovered in a loaded document are rejected