Jean-Fran├žois ROLLAND created FOP-2665:

             Summary: Bug when using the bold version of an otf font - maybe 
bad fullName computation in OTFFile
                 Key: FOP-2665
             Project: FOP
          Issue Type: Bug
          Components: unqualified
    Affects Versions: 2.1
         Environment: Windows 7 Service Pack 1, jdk1.7.0_40, fop-2.1, 
            Reporter: Jean-Fran├žois ROLLAND
             Fix For: 2.1

I get this message when using the bold version of Noto Sans CJK JP :
Font "Noto Sans CJK JP,normal,700" not found. Substituting with "Noto Sans CJK 

Steps to reproduce

1. Use this xconf :

<fop version="1.0">
    <renderer mime="application/pdf">
        <!-- register all the fonts found in a directory -->
        <directory recursive="true">path to font directory</directory>

2. Set a valid path for "path to font directory", and set there the Noto Sans 
CJK JP fonts, that you can get from there :

3. Use the code from this page :

4. Use this "" as input :

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="";>
  <!-- defines the layout master -->
    <fo:simple-page-master master-name="first" page-height="29.7cm" 
page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" 
      <fo:region-body margin-top="1cm"/>
      <fo:region-before extent="1cm"/>
      <fo:region-after extent="1.5cm"/>

  <!-- starts actual layout -->
  <fo:page-sequence master-reference="first">
    <fo:flow flow-name="xsl-region-body">
      <fo:block font-family="Noto Sans CJK JP" font-size="12pt" 
        Some special characters:

Actual Results:
I get this message :
Font "Noto Sans CJK JP,normal,700" not found. Substituting with "Noto Sans CJK 
And my text in the generated pdf is not bold.

Expected Results:
The message should not appear, and the text in the generated pdf should be bold.

Additional Information:
If I change the OTFFile.readName() method with this code:
        protected void readName() throws IOException {
                Object familyName = fileFont.getProperty("FamilyName");
                if (familyName != null && !familyName.equals("")) {
                        fullName = fileFont.getName();
                } else {
                        fullName = fileFont.getName();

More precisely :
I replace
fullName = familyName.toString();
fullName = fileFont.getName();
it solves the bug.

This message was sent by Atlassian JIRA

Reply via email to