DynaPDF Manual - Page 53

Previous Page 52   Index   Next Page 54

Complex Text Layout
Page 53 of 839
The alternate font list can be changed arbitrary often with no additional overhead.
The function to manage alternate font lists are:
ActivateAltFontList() // Activate or deactivate a font list
CreateAltFontList()
// Create a font list
DeleteAltFontList()
// Delete a font list
SetAltFonts()
// Fill a list with data
Font embedding
With exception of CJK scripts (Chinese, Japanese, Korean) complex text layout depends on font
embedding. Fonts must be embedded because glyphs are usually selected with OpenType
layout features. Such glyphs have mostly no Unicode code point and can therefore not be
selected with simple algorithms.
Chinese, Japanese, and Korean scripts are exceptions, because the PDF format supports special
features like CID Fonts in combination with external cmaps, so that fonts for these scripts must
not necessarily be embedded. This is very important because Asian documents contain usually
much more glyphs in comparison to other languages. Therefore, such documents are much
larger. Non embedded CID fonts can be loaded with SetCIDFont().
Complex text layout and form fields
One thing that must be considered is that the support level of complex text layout in Adobes
Acrobat is limited. The support level is comparable with web browsers. That means basic
shaping and the bidirectional algorithm are available, but Unicode bidi control characters are
not supported and mixed languages produce not always correct results.
Since the appearance of form fields should ideally not change when a user activates a field in
Acrobat, DynaPDF strips out all bidi control characters when setting a field value.
This makes sure that the appearance stream can be created in a comparable way and Acrobat is
able to display a field value correctly.
The very same result can be achieved with regular text functions by setting the flag
gfDisableBidiCtrls with SetGStateFlags().
 

Previous topic: Complex Text Layout, How to enable Complex Text Layout?, Automatic Font Substitution, Alternate font lists

Next topic: JSON Parser