NishilSB / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 1 forks source link

Embedded Fonts #263

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

How can I use a special font such as Forte? I would like see a code example. I 
am a novice in alive pdf 

Original issue reported on code.google.com by blasr...@gmail.com on 21 Jul 2010 at 6:14

GoogleCodeExporter commented 8 years ago
Hi. First of all you need the font in *.ttf format and the adobe font metrics 
file *.afm related to this font. Generating the afm is simple here:
http://fpdf.fruit-lab.de/

Example:
[Embed( source="fonts/fff.ttf", mimeType="application/octet-stream" )]
public var times_ttf:Class;
[Embed( source="fonts/fff.afm", mimeType="application/octet-stream" )]
public var times_afm:Class;
...
var f:EmbeddedFont = new EmbeddedFont(new times_ttf() as ByteArray, new 
times_afm() as ByteArray, CodePage.CP1252); 
pdf.setFont(f, 16);
pdf.addText("This works!");
...

Original comment by dimadeve...@gmail.com on 23 Nov 2010 at 11:45

GoogleCodeExporter commented 8 years ago
can we convert ARIALUNI.TTF to .afm?
abhishekchess1@gmail.com

Original comment by abhishek...@gmail.com on 3 Sep 2012 at 8:07