10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CJK host font names on Windows can be supplied to PDF_load_font( ) as UTF-8 withinitial BOM, or UTF-16. Non-Latin host font names are not supported on the Mac,though.> Treatment of non-Unicode CMaps: if the keepnative option is true, native codes (e.g.Shift-JIS) will be written to the PDF output; otherwise the text will be converted toUnicode. The visual appearance will be identical in both cases, but this option affectsthe use of such fonts for Textflow and form fields (see description of keepnative inthe PDFlib Reference). In order to avoid subtle problems in Acrobat we recommendto set keepnative=false if no font embedding is desired, and to set embedding=true ifkeepnative=true is desired.Note Windows EUDC fonts (end-user defined characters) are supported, but linking individual enduserdefined characters into all fonts is not supported (see »End-user defined characters(EUDC)«, page 119).Custom CJK font example with Japanese Shift-JIS text. The following C example usesthe MS Mincho font to display some Japanese text which is supplied in Shift-JIS formataccording to Windows code page 932:font = PDF_load_font(p, "MS Mincho", 0, "cp932", "");if (font == -1) { ... }PDF_setfont(p, font, 24);PDF_set_text_pos(p, 50, 500);PDF_show2(p, "\x82\xA9\x82\xC8\x8A\xBF\x8E\x9A", 8);Custom CJK font example with Chinese Unicode text. The following example uses theArialUnicodeMS font to display some Chinese text. The font must either be installed onthe system or must be configured according to Section 5.3.1, »Searching for Fonts«, page101):font = p.load_font("Arial Unicode MS", "unicode", "");p.setfont(font, 24);p.set_text_pos(50, 500);p.show("\u4e00\u500b\u4eba");Accessing individual fonts in a TrueType Collection (TTC). TTC files contain multipleseparate fonts. You can access each font by supplying its proper name. However, if youdon’t know which fonts are contained in a TTC file you can numerically address eachfont by appending a colon character and the number of the font within the TTC file(starting with 0). If the index is 0 it can be omitted. For example, the TTC file msgothic.ttccontains multiple fonts which can be addressed as follows in PDF_load_font( ) (each linecontains equivalent font names):msgothic:0 MS Gothic msgothic:msgothic:1 MS PGothicmsgothic:2 MS UI GothicNote that msgothic (without any suffix) will not work as a font name since it does notuniquely identify a font. Font name aliases (see Section , »Sources of Font Data«, page118 Chapter 5: Font Handling

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!