Bug 53142 - non-embedded fonts are incorrectly assumed to be single byte, even when they are multi byte
Summary: non-embedded fonts are incorrectly assumed to be single byte, even when they ...
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts (show other bugs)
Version: trunk
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-24 19:47 UTC by Glenn Adams
Modified: 2012-04-24 20:03 UTC (History)
1 user (show)



Attachments
input FO file (483 bytes, text/xml)
2012-04-24 19:47 UTC, Glenn Adams
Details
FOP configuration file (412 bytes, application/octet-stream)
2012-04-24 19:49 UTC, Glenn Adams
Details
console log (561 bytes, application/octet-stream)
2012-04-24 19:49 UTC, Glenn Adams
Details
output PDF file (6.37 KB, application/pdf)
2012-04-24 19:50 UTC, Glenn Adams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Adams 2012-04-24 19:47:55 UTC
Created attachment 28669 [details]
input FO file

the following code in o.a.f.fonts.truetype.TTFFontLoader incorrectly assumes that a non-embedded font is a single byte font:

        boolean isCid = this.embedded;
        if (this.encodingMode == EncodingMode.SINGLE_BYTE) {
            isCid = false;
        }

        if (isCid) {
            multiFont = new MultiByteFont();
            returnFont = multiFont;
            multiFont.setTTCName(ttcFontName);
        } else {
            singleFont = new SingleByteFont();
            returnFont = singleFont;
        }

this prevents the use of non-embedded (referenced only) multibyte fonts

the attached input FO file and corresponding FOP configuration make use of the simsun.ttf font (a multibyte font) which can be downloaded from [1]

[1] http://jumal.is.free.fr/SimSun.ttf
Comment 1 Glenn Adams 2012-04-24 19:49:07 UTC
Created attachment 28670 [details]
FOP configuration file

simsun.ttf should be downloaded and placed into a ./fonts directory
Comment 2 Glenn Adams 2012-04-24 19:49:45 UTC
Created attachment 28671 [details]
console log
Comment 3 Glenn Adams 2012-04-24 19:50:45 UTC
Created attachment 28672 [details]
output PDF file

output when configured for referencing (non-embedding)