Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 620

Previous Page 619   Index   Next Page 621

Function Reference
Page 620 of 750
Please note that DynaPDF knows nothing about the encoding when using a font with an external
CMap. Functions which output formatted text like WriteFText() can only be used with CMaps which
map Unicode (UTF-16) to CIDs. The wide string version of the function must be used in this case.
Word Spacing
Word spacing applies to the space character of a string. However, most CJK encodings support more
than one space character, such as a proportional space, ideographic space, full width space, half
width space and many more. DynaPDF treats always CID 1 as space character, independent of the
used character collection. All other CIDs are treated as ordinary glyphs.
Vertical Writing Mode
When using a CMap for vertical writing mode the text extends always from top to bottom. The
coordinate origin of the text depends on the font origin (see SetFontOrigin()). If the font origin is set
to orDownLeft the first character is placed on the font's baseline. This can be somewhat confusing
because the remaining text is of course placed below the first character. It is usually best to set the
font origin to orTopLeft, also if bottom up coordinates are used.
Because the text width is simply the font size, GetTextWidth() returns the text height in vertical
writing mode.
Encodings Identity-H and Identity-V
Iit is also possible to load TrueType and OpenType fonts with the special encodings Identity-H or
Identity-V with this function. These are encodings and no predefined external CMaps. That means
the CID-keyed font architecture is not used.
A font that was loaded with these encodings can be used as if it were loaded with SetFont() with the
code page cpUnicode. The only difference is that the font can be left unembedded. However, the
PDF file stores glyph indexes instead of CIDs and glyph indexes are private for every font. That
means if the original font is not available on the system then it is not possible to display the text!
It is not recommended to use these encodings with non-embedded fonts, although it works. If you
want to use fonts with these encodings then make sure that you use only standard fonts which are
normally available on the users system. The encodings Idenitity-H and Identity-V require Acrobat 6
or higher. Due to a change in the font search algorithm in Acrobat 10 it is no longer possible to
display such files with Acrobat 4/5.
Known issues:
At time of publication CID fonts cannot be used with form fields.
Vertical writing mode does not work with WriteFText().
All functions which output text report a warning if one or more characters cannot be found. Call
GetMissingGlyphs() to determine which characters could not be found.

Previous topic: SetCIDFont

Next topic: SetCMapDir