RafaelOliveira / alivepdf

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

Unicode Font Embed problem #255

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I am trying to embed an Unicode font (I have tried with different fonts, then 
lastly with Virnda to support Bengali), but the font isn't embedded.

I have done these:

1. convert the vrinda.ttf using http://fpdf.fruit-lab.de/ tool.
2. Ebmed the font:

            [Embed(source="../assets/vrinda.ttf", mimeType="application/octet-stream")]
            private var fontStream:Class;

            [Embed(source="../assets/vrinda.afm", mimeType="application/octet-stream")]
            private var afmStream:Class;

3. then in my processPrint() function:

var fStream:ByteArray = new fontStream() as ByteArray;
                    var aStream:ByteArray = new afmStream() as ByteArray;
                    var printPDF:UnicodePDF = new UnicodePDF(Orientation.LANDSCAPE, Unit.MM, true,Size.LETTER);
                    var ef:EmbeddedFont = new EmbeddedFont( fStream, aStream, CodePage.CP1252);
                    var msg:String = "Electronic File Register System";
                    printPDF.addPage();
                    printPDF.setDisplayMode (Display.FULL_WIDTH,Layout.SINGLE_PAGE);
                    printPDF.setFontSize(25);
                    printPDF.setXY(60,80);
                    printPDF.writeText(5,msg);
                    printPDF.setFont(ef,12);
................
................

Would you please tell me what I am doing wrong. Thanks for your help. I am 
stuck at this problem for 2 days :(

Original issue reported on code.google.com by iamba...@gmail.com on 29 Jun 2010 at 2:54

GoogleCodeExporter commented 9 years ago
Ok. I got the problem, it seems when I used UnicodePDF class, the font wasn't 
embedded. But using PDF class solves the problem.

But new problem, I need to support Unicode characters. So problem again :(

Original comment by iamba...@gmail.com on 29 Jun 2010 at 10:21