0

I need some specifics symbols from my pdf. If I use ttf+afm embeded fonts I need specify CodePage like 1251. And after convert some symbols (√, ²) displays like "?".

[Embed(source="/Klassy_obshchikh_komponentov/CreatePDF/alivepdf/fonts/embeded/ArialI.ttf", mimeType="application/octet-stream")]
    private var _fontTtf:Class;

    [Embed(source="/Klassy_obshchikh_komponentov/CreatePDF/alivepdf/fonts/embeded/ArialCyrMT-Italic.afm", mimeType="application/octet-stream")]
    private var _fontAfm:Class;

    pdfItem.setFont(new EmbeddedFont(new _fontTtf(), new _fontAfm(), CodePage.CP1251), textHeight*5);

pdfItem.addText (Convert(text), x, y);

    private function Convert(data:String):String 
    {
       var byteDataArray:ByteArray = new ByteArray();
       byteDataArray.writeMultiByte(data,"windows-1251"); 
       return byteDataArray.toString();
    }

I want use .otf font file and unicode. But I can not find how to do it. Anybody nows how to embed .otf font and use it without converting.

Jakobinec
  • 63
  • 13
  • Are you using an actual **unicode** supporting font (that has those symbols etc)? `Codepage` should not be necessary in your code. I use Microsoft's Arial Unicode (ttf) and it shows even Japanese or Arabic & math symbols & much more... Show an example of one sentence you cannot display & I'll try show you how to fix it... – VC.One Nov 29 '16 at 20:46
  • If I try to set Codepage to null throws runtime error. Do you use an EnbededFont class to set font? Do you can write your embeded font initializing? – Jakobinec Nov 30 '16 at 10:12

0 Answers0