diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-05-28 14:31:24 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-05-28 14:31:24 +0000 |
commit | 8c1aba3f976127d33ec50b67d760f56364c08487 (patch) | |
tree | adfdca730f41c1b9029324bf53535aa25bf16d27 /src/java/org/apache/fop/fonts/apps | |
parent | 7ada0a06fe2b9ce0e1867d2c9c47f71ea47a43b2 (diff) | |
download | xmlgraphics-fop-8c1aba3f976127d33ec50b67d760f56364c08487.tar.gz xmlgraphics-fop-8c1aba3f976127d33ec50b67d760f56364c08487.zip |
Bugzilla #41831:
- Add support font auto-detection (easier font configuration) including a font cache to speed up the auto-detection process.
- Refactoring of the configuration code: All Avalon configuration stuff is extracted into separate "Configurator" classes.
- Refactoring of the FOURIResolver.
Submitted by: Adrian Cumiskey <fop-dev.at.cumiskey.com>
Changes to the patch by jeremias during the review:
- Font cache simplified (Java object serialization instead of XML), functionality fixed and moved to the fonts.package.
- Relocated default cache file location to user directory.
- Fixed the font configuration for PDFDocumentGraphics2D/PDFTranscoder that got lost with the patch.
- Fixed a problem with having a non-file URL as font base URL.
- Simplified RendererContextInfo stuff to make it easier to understand.
- Fixed handling of Type 1 fonts in auto-detection.
- Reduced verbosity of font-related log output.
- Updated Jakarta Commons IO to version 1.3.1 (the patch depends on it)
- Various javadocs improvements
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@542237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fonts/apps')
-rw-r--r-- | src/java/org/apache/fop/fonts/apps/TTFReader.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/fonts/apps/TTFReader.java b/src/java/org/apache/fop/fonts/apps/TTFReader.java index 93388c34f..4d5cc3942 100644 --- a/src/java/org/apache/fop/fonts/apps/TTFReader.java +++ b/src/java/org/apache/fop/fonts/apps/TTFReader.java @@ -27,6 +27,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.apache.commons.logging.LogFactory; import org.apache.fop.Version; +import org.apache.fop.fonts.FontUtil; import org.apache.fop.fonts.truetype.FontFileReader; import org.apache.fop.fonts.truetype.TTFCmapEntry; import org.apache.fop.fonts.truetype.TTFFile; @@ -258,10 +259,10 @@ public class TTFReader extends AbstractFontReader { // "Perpetua-Bold", but the TrueType spec says that in the ttf file // it should be "Perpetua,Bold". - String s = stripWhiteSpace(ttf.getPostScriptName()); + String s = FontUtil.stripWhiteSpace(ttf.getPostScriptName()); if (fontName != null) { - el.appendChild(doc.createTextNode(stripWhiteSpace(fontName))); + el.appendChild(doc.createTextNode(FontUtil.stripWhiteSpace(fontName))); } else { el.appendChild(doc.createTextNode(s)); } @@ -450,22 +451,6 @@ public class TTFReader extends AbstractFontReader { } - private String stripWhiteSpace(String s) { - char[] ch = new char[s.length()]; - s.getChars(0, s.length(), ch, 0); - StringBuffer stb = new StringBuffer(); - for (int i = 0; i < ch.length; i++) { - if (ch[i] != ' ' - && ch[i] != '\r' - && ch[i] != '\n' - && ch[i] != '\t') { - stb.append(ch[i]); - } - } - - return stb.toString(); - } - /** * Bugzilla 40739, check that attr has a metrics-version attribute * compatible with ours. |