Преглед на файлове

Made some tables in the TTF embedding optional to be compatible with more

fonts. This adheres to the TrueType spec, and makes the MS OpenType
extras optional.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194197 13f79535-47bb-0310-9956-ffa450edef68
pull/33/head
Kelly Campbell преди 23 години
родител
ревизия
dda180e99f
променени са 1 файла, в които са добавени 42 реда и са изтрити 5 реда
  1. 42
    5
      src/org/apache/fop/fonts/TTFSubSetFile.java

+ 42
- 5
src/org/apache/fop/fonts/TTFSubSetFile.java Целия файл

@@ -10,6 +10,7 @@ import java.io.*;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.apache.fop.messaging.MessageHandler;

/**
* Reads a TrueType file and generates a subset
@@ -578,16 +579,52 @@ public class TTFSubSetFile extends TTFFile {
scanGlyphs(in, glyphs);

createDirectory(); // Create the TrueType header and directory
createCvt(in); // copy the cvt table
createFpgm(in); // copy fpgm table

createHead(in);
createHhea(in, glyphs.size()); // Create the hhea table
createHmtx(in, glyphs); // Create hmtx table
createMaxp(in, glyphs.size()); // copy the maxp table
createPrep(in); // copy prep table
createLoca(glyphs.size()); // create empty loca table
createGlyf(in, glyphs);

try {
createCvt(in); // copy the cvt table
}
catch (IOException ex) {
// Cvt is optional (only required for OpenType (MS) fonts)
MessageHandler.errorln("TrueType warning: "+ex.getMessage());
}
try {
createFpgm(in); // copy fpgm table
}
catch (IOException ex) {
// Fpgm is optional (only required for OpenType (MS) fonts)
MessageHandler.errorln("TrueType warning: "+ex.getMessage());
}

try {
createPrep(in); // copy prep table
}
catch (IOException ex) {
// Prep is optional (only required for OpenType (MS) fonts)
MessageHandler.errorln("TrueType warning: "+ex.getMessage());
}
try {
createLoca(glyphs.size()); // create empty loca table
}
catch (IOException ex) {
// Loca is optional (only required for OpenType (MS) fonts)
MessageHandler.errorln("TrueType warning: "+ex.getMessage());
}
try {
createGlyf(in, glyphs);
}
catch (IOException ex) {
// Glyf is optional (only required for OpenType (MS) fonts)
MessageHandler.errorln("TrueType warning: "+ex.getMessage());
}
pad4();
createCheckSumAdjustment();


Loading…
Отказ
Запис