jeremias    2003/02/13 09:19:13

  Modified:    src/org/apache/fop/fonts Tag: fop-0_20_2-maintain
                        TTFSubSetFile.java
  Log:
  TrueType embedding: FPGM table is optional, so ignore it if it's not there.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.4   +12 -6     xml-fop/src/org/apache/fop/fonts/Attic/TTFSubSetFile.java
  
  Index: TTFSubSetFile.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/Attic/TTFSubSetFile.java,v
  retrieving revision 1.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- TTFSubSetFile.java        21 Nov 2002 21:58:49 -0000      1.5.2.3
  +++ TTFSubSetFile.java        13 Feb 2003 17:19:13 -0000      1.5.2.4
  @@ -88,10 +88,12 @@
           currentPos += 12;
           realSize += 16;
   
  -        writeString("fpgm");
  -        fpgmDirOffset = currentPos;
  -        currentPos += 12;
  -        realSize += 16;
  +        if (hasFpgm()) {
  +            writeString("fpgm");
  +            fpgmDirOffset = currentPos;
  +            currentPos += 12;
  +            realSize += 16;
  +        }
   
           writeString("glyf");
           glyfDirOffset = currentPos;
  @@ -153,6 +155,9 @@
       }
   
   
  +    private boolean hasFpgm() {
  +        return (dirTabs.get("fpgm") != null);
  +    }
   
       /**
        * Copy the fpgm table as is from original font to subset font
  @@ -171,7 +176,8 @@
               currentPos += (int)entry.length;
               realSize += (int)entry.length;
           } else {
  -            throw new IOException("Can't find fpgm table");
  +            //fpgm table is optional
  +            //throw new IOException("Can't find fpgm table");
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to