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.

the contents of the characters in a Type 3 font. Combined with the PDF import libraryPDI you can even import complex drawings as a PDF page, and use those for defining acharacter in a Type 3 font.Note PostScript Type 3 fonts are not supported.Type 3 fonts must completely be defined outside of any page (more precisely, the fontdefinition must take place in document scope). The following example demonstrates thedefinition of a simple Type 3 font:p.begin_font("Fuzzyfont", 0.001, 0.0, 0.0, 0.001, 0.0, 0.0, "");p.begin_glyph("circle", 1000, 0, 0, 1000, 1000);p.arc(500, 500, 500, 0, 360);p.fill();p.end_glyph();p.begin_glyph("ring", 400, 0, 0, 400, 400);p.arc(200, 200, 200, 0, 360);p.stroke();p.end_glyph();p.end_font();Cookbook Full code samples can be found in the Cookbook topics fonts/starter_type3font, fonts/type3_bitmaptext, fonts/type3_rasterlogo, and fonts/type3_vectorlogo.The font will be registered in PDFlib, and its name can be supplied to PDF_load_font( )along with an encoding which contains the names of the glyphs in the Type 3 font.Please note the following when working with Type 3 fonts:> Similar to patterns and templates, images cannot be opened within a glyph description.However, they can be opened before starting a glyph description, and placedwithin the glyph description. Alternatively, inline images may be used for small bitmapsto overcome this restriction.> Due to restrictions in PDF consumers all characters used in text output must actuallybe defined in the font: if character code x is to be displayed with PDF_show( ) or asimilar function, and the encoding contains glyphname at position x, then glyphnamemust have been defined via PDF_begin_glyph( ). This restriction affects only Type 3fonts; missing glyphs in PostScript Type 1, TrueType, or OpenType fonts will simplybe ignored.> Some PDF consumers require a glyph named .notdef if codes will be used for whichthe corresponding glyph names are not defined in the font. Acrobat 8 may evencrash if a .notdef glyph is not present. The .notdef glyph must be present, but it maysimply contain an empty glyph description.> When normal bitmap data is used to define characters, unused pixels in the bitmapwill print as white, regardless of the background. In order to avoid this and have theoriginal background color shine through, use the mask parameter for constructingthe bitmap image.> The interpolate option for images may be useful for enhancing the screen and printappearance of Type 3 bitmap fonts.> Type 3 fonts do not contain any typographic properties such as ascender, descender,etc. However, these can be set by using the corresponding options in PDF_load_font( ).100 Chapter 5: Font Handling

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

Saved successfully!

Ooh no, something went wrong!