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 Long

DLL

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

FontIDHandle of a Type 3 font created by AddType3Font or BeginFont
CharCodeByte code from 0 through 255 that the glyph is bound to
GlyphNameUnique 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
UnicodeTextText-extraction mapping; an empty value is inferred from a uniXXXX name, a single printable character name, space, or a printable character code
WidthXHorizontal glyph displacement in glyph space; 0 for upright glyphs
WidthYVertical glyph displacement in glyph space; 0 for upright glyphs
LLXLeft edge of the glyph bounding box in glyph space
LLYBottom edge of the glyph bounding box in glyph space
URXRight edge of the glyph bounding box; it must be greater than or equal to LLX
URYTop edge of the glyph bounding box; it must be greater than or equal to LLY
ContentPDF graphics operators of the glyph program without d0 or d1; the library writes the required metrics first

Return values

1The glyph stream and derived font tables were updated
0The 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