DynaPDF Manual - Page 682

Previous Page 681   Index   Next Page 683

Function Reference
Page 682 of 777
with a "_Uni", e.g. cpCJK_Big5_Uni or cpCJK_932_Uni. The "CJK" in the code page name indicates
that mixed 8/16 bit CJK input character sequences must be used with this encoding.
The "_Uni" at the end of the name means that this code page can be used with a Unicode font. CJK to
Unicode conversion algorithms are available in the Ansi versions of string methods only. This is
normally no limitation because CJK strings are usually not defined as wide-strings.
The other CJK code pages which are available in DynaPDF are those without the "_Uni" at the end of
the name, such as cpShiftJIS, cpGB2312, and so on. These code pages represent character sets and no
code pages. The usage of a pure CJK encoding requires that the TrueType or OpenType font contains
a CMap in format 2. This is mostly the case in pure CJK fonts (fonts which provide no Unicode based
CMap). Unlike the CJK to Unicode code pages, these character sets can be used with the Ansi and
wide string versions of a text method. Native character sets are faster than Unicode based versions
because no string conversion is required.
In addition to the above code pages and character sets DynaPDF supports also the CID-Keyed font
architecture which was specifically designed to process Asian languages. See SetCIDFont() for
further information.
GDI Font selection in comparison to DynaPDF
The Windows GDI selects a font in another way than DynaPDF does. Let us see how a font can be
selected with the GDI function CreateFont() and where are the differences in comparison to
HFONT f = CreateFont(
// height of font
// average character width
// angle of escapement
// base-line orientation angle
// font weight
// italic attribute option
// underline attribute option
// strikeout attribute option
// character set identifier
// output precision
CLIP_DEFAULT_PRECIS, // clipping precision
ANTIALIASED_QUALITY, // output quality
// pitch and family
// typeface name (Family Name)
The GDI supports three modes how the font size or height can be specified. We want to discuss
negative values only because the other modes are not of interest for high precision output (positive
values specify the cell height of a font, this value must be converted by DynaPDF to determine the
wished font size). The font height we used in the example CreateFont() function call is defined as a
negative value. The absolute value of it is transformed to device units by the font mapper. We choose
a size of 240 units; this is a normal font size for a 1440 DPI output.

Previous topic: How to use CJK encodings?

Next topic: nWidth, nEscapement