mgchetla / jmesa

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

correct display of Russian characters when exporting to pdfp of jmesa #220

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Good day! I agonized for a long time, trying to make the correct display 
of Russian characters when exporting to pdfp of jmesa. And, finally, 
editing the source code jmesa, I realized that the file PdfPView.java in 
the method getFontWithColor need to pass a string BaseFont.IDENTITY_H, but 
not fontEncoding. I decided that showing export.pdf.fontEncoding = 
Identity-H in my jmesa.properties file.

Original issue reported on code.google.com by stas.agarkov on 2 Oct 2009 at 11:30

GoogleCodeExporter commented 8 years ago
I found the file in the library iText BaseFont.java this code:

if (nameBase.toLowerCase().endsWith(".ttf") || nameBase.toLowerCase().endsWith
(".otf") || nameBase.toLowerCase().indexOf(".ttc,") > 0) {
            if (encoding.equals(IDENTITY_H) || encoding.equals(IDENTITY_V))
                fontBuilt = new TrueTypeFontUnicode(name, encoding, embedded, 
ttfAfm, forceRead);
            else {
                fontBuilt = new TrueTypeFont(name, encoding, embedded, ttfAfm, 
false, forceRead);
                fontBuilt.fastWinansi = encoding.equals(CP1252);
            }
        }

If encoding is not equal to line "IDENTITY-H" or "IDENTITY-V", it is created 
non-
Unicode font, and so the Cyrillic characters are displayed incorrectly.

Original comment by stas.agarkov on 21 Oct 2009 at 12:14

GoogleCodeExporter commented 8 years ago
Is it working for you now? If so then what I need to do is make sure that the 
feature
is documented! Thank you for the code snippet. I will include that as well, as I
could see that offering a lot of clarity to why the fontName and fontEncoding is
necessary.

Original comment by jeff.johnston.mn@gmail.com on 22 Oct 2009 at 5:53

GoogleCodeExporter commented 8 years ago
Yes, it works now. Since I need to create a Unicode font, but it creates only 
when 
the encoding is equal to line "IDENTITY_H" or "IDENTITY_V", then we have to 
specify 
the encoding as these lines! I think this is a iText error.

Original comment by stas.agarkov on 5 Nov 2009 at 2:49

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 10 Mar 2011 at 10:09