aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-08-13 09:10:49 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-08-13 09:10:49 +0000
commit427e2d22a628b77cce5e7c22b32610b5ff23d8b2 (patch)
treeefea32987c3278d793119f327954612a5c57e35f /src/java/org/apache/fop/render
parent07a228bf39e75a670b91aa9d98c440e4fae782ad (diff)
downloadxmlgraphics-fop-427e2d22a628b77cce5e7c22b32610b5ff23d8b2.tar.gz
xmlgraphics-fop-427e2d22a628b77cce5e7c22b32610b5ff23d8b2.zip
Merged revisions 682600,682604-682605,682616-682618,682625,682630,683136,683159,683684,684041,684491,684493,684575,684577 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ................ r682600 | jeremias | 2008-08-05 07:46:31 +0100 (Tue, 05 Aug 2008) | 8 lines Blocked revisions 681371 via svnmerge ........ r681371 | jeremias | 2008-07-31 15:54:16 +0200 (Do, 31 Jul 2008) | 1 line Adjust fop.bat to JAR upgrade. ........ ................ r682604 | jeremias | 2008-08-05 07:51:32 +0100 (Tue, 05 Aug 2008) | 26 lines Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-638936,638938-640888,640890-642905,642907-647402,647404-647536,647538-648983,648985-649005,649007-649013,649015-650549,650551-651301,651303-653536,653538-654452,654454-656285,656287-656523,656525-657519,657521-661579,661581-663481,663483-664691,664693-666634,666636-666661,666663-668532,668535-668549,668551-668569,668571-668640,668642-669117,669119-669172,669174-669477,669479-670550,670552-673749,673751-674303,674305-674313,674315-674316,674318-675105,675107-675149,675153-675706,675708-680714,680716-680819,680821-681283,681285,681287-681289,681293-681370,681372-682601 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r681309 | jeremias | 2008-07-31 11:31:35 +0200 (Do, 31 Jul 2008) | 2 lines 0.95beta -> 0.95 Added links to the new SVN mirror in the Netherlands. ........ r681314 | vhennebert | 2008-07-31 11:41:33 +0200 (Do, 31 Jul 2008) | 2 lines Corrected bug number ........ r681329 | vhennebert | 2008-07-31 12:38:10 +0200 (Do, 31 Jul 2008) | 2 lines Slight re-phrasing to make it clearer (I believe) that this page only lists changes made since 0.95beta, but that changes from that latter are of course also available in 0.95 final ........ r681330 | vhennebert | 2008-07-31 12:39:50 +0200 (Do, 31 Jul 2008) | 2 lines Don't be shy Max ;-) Restored alphabetical order in the list of active committers ........ r681350 | jeremias | 2008-07-31 14:09:41 +0200 (Do, 31 Jul 2008) | 1 line Fixed validation errors. ........ ................ r682605 | jeremias | 2008-08-05 07:55:12 +0100 (Tue, 05 Aug 2008) | 3 lines Removed merge tracking for "svnmerge" for https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ................ r682616 | jeremias | 2008-08-05 08:46:14 +0100 (Tue, 05 Aug 2008) | 1 line Skip IO Exception when loading a PFM and an AFM could be loaded. The PFM is only a fallback and not necessary when the AFM is available. Motivation: The "URW Bookman L" fonts from GhostScript have bad PFM files. ................ r682617 | jeremias | 2008-08-05 08:47:18 +0100 (Tue, 05 Aug 2008) | 1 line The FontEventListener was not wired into font auto-detection. An error while loading a font wasn't relayed to the event subsystem. ................ r682618 | jeremias | 2008-08-05 08:57:36 +0100 (Tue, 05 Aug 2008) | 1 line Fixed small mistake with weight adjustment on font lookup. Weight 400 was slipping through the cracks. ................ r682625 | jeremias | 2008-08-05 09:12:25 +0100 (Tue, 05 Aug 2008) | 2 lines Removed "Areas of expertise" as discussed. News update for 0.95 release. ................ r682630 | jeremias | 2008-08-05 09:28:07 +0100 (Tue, 05 Aug 2008) | 1 line Oopsy, that wasn't intended to get into trunk. ................ r683136 | jeremias | 2008-08-06 07:49:36 +0100 (Wed, 06 Aug 2008) | 1 line Some missing release info. ................ r683159 | jeremias | 2008-08-06 09:24:53 +0100 (Wed, 06 Aug 2008) | 1 line Converted the project news to a special XML format so I can generate an RSS feed. Mostly copied from XML Graphics Commons. ................ r683684 | jeremias | 2008-08-07 20:26:54 +0100 (Thu, 07 Aug 2008) | 1 line Added fop.cmd to binary distribution (not sure if any of the others should be included, too) ................ r684041 | spepping | 2008-08-08 19:38:07 +0100 (Fri, 08 Aug 2008) | 2 lines Added fop.js to binary distribution ................ r684491 | adelmelle | 2008-08-10 13:35:42 +0100 (Sun, 10 Aug 2008) | 1 line Bugzilla 45490: Avoid altering the original 'href' if the protocol is other than 'file:' (suggested by Thomas Stieler) ................ r684493 | adelmelle | 2008-08-10 13:40:58 +0100 (Sun, 10 Aug 2008) | 1 line Added 'due-to' to the wrong entry... ................ r684575 | jeremias | 2008-08-10 20:18:22 +0100 (Sun, 10 Aug 2008) | 2 lines Merge from 0_95 branch: Fixed ID resolution for nested bookmarks with duplicated IDs. ................ r684577 | jeremias | 2008-08-10 20:35:27 +0100 (Sun, 10 Aug 2008) | 3 lines Bugzilla #45606: Fixed generation of "fonttbl" for RTF output to fix loading problem with AbiWord. Submitted by: Pavel Kysilka <goldenfish.at.linuxsoft.cz> ................ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@685487 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render')
-rw-r--r--src/java/org/apache/fop/render/PrintRendererConfigurator.java32
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java15
2 files changed, 30 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/render/PrintRendererConfigurator.java b/src/java/org/apache/fop/render/PrintRendererConfigurator.java
index 4409c62b8..e8127ae34 100644
--- a/src/java/org/apache/fop/render/PrintRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/PrintRendererConfigurator.java
@@ -43,6 +43,8 @@ import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.fonts.EmbedFontInfo;
import org.apache.fop.fonts.FontCache;
+import org.apache.fop.fonts.FontEventAdapter;
+import org.apache.fop.fonts.FontEventListener;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.fonts.FontResolver;
@@ -94,8 +96,10 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
boolean strict = factory.validateUserConfigStrictly();
FontCache fontCache = fontManager.getFontCache();
+ FontEventListener listener = new FontEventAdapter(
+ renderer.getUserAgent().getEventBroadcaster());
List/*<EmbedFontInfo>*/ embedFontInfoList = buildFontListFromConfiguration(cfg,
- fontResolver, strict, fontManager);
+ fontResolver, strict, fontManager, listener);
if (fontCache != null && fontCache.hasChanged()) {
fontCache.save();
@@ -110,12 +114,14 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
* @param fontResolver the FontResolver to use
* @param strict true if an Exception should be thrown if an error is found.
* @param fontManager the font manager
+ * @param listener a font event listener
* @return a List of EmbedFontInfo objects.
* @throws FOPException If an error occurs while processing the configuration
*/
public static List/*<EmbedFontInfo>*/ buildFontListFromConfiguration(Configuration cfg,
FontResolver fontResolver,
- boolean strict, FontManager fontManager) throws FOPException {
+ boolean strict, FontManager fontManager,
+ FontEventListener listener) throws FOPException {
FontCache fontCache = fontManager.getFontCache();
String fontBaseURL = fontManager.getFontBaseURL();
List/*<EmbedFontInfo>*/ fontInfoList
@@ -144,7 +150,8 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
fontFileFinder.find(fontBase.getAbsolutePath()),
fontInfoList,
fontResolver,
- fontCache
+ fontCache,
+ listener
);
}
} catch (IOException e) {
@@ -158,7 +165,8 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
fontFileFinder.find(),
fontInfoList,
fontResolver,
- fontCache
+ fontCache,
+ listener
);
} catch (IOException e) {
LogUtil.handleException(log, e, strict);
@@ -167,12 +175,12 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
// load fonts from classpath
addFontInfoListFromFileList(ClasspathResource.getInstance()
.listResourcesOfMimeType("application/x-font"),
- fontInfoList, fontResolver, fontCache);
+ fontInfoList, fontResolver, fontCache, listener);
addFontInfoListFromFileList(
ClasspathResource.getInstance()
.listResourcesOfMimeType(
"application/x-font-truetype"),
- fontInfoList, fontResolver, fontCache);
+ fontInfoList, fontResolver, fontCache, listener);
}
// directory (multiple font) configuration
@@ -197,7 +205,8 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
fontFileFinder.find(directory),
fontInfoList,
fontResolver,
- fontCache
+ fontCache,
+ listener
);
} catch (IOException e) {
LogUtil.handleException(log, e, strict);
@@ -208,7 +217,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
Configuration[] font = fonts.getChildren("font");
for (int i = 0; i < font.length; i++) {
EmbedFontInfo embedFontInfo = getFontInfoFromConfiguration(
- font[i], fontResolver, strict, fontCache);
+ font[i], fontResolver, strict, fontCache, listener);
if (embedFontInfo != null) {
fontInfoList.add(embedFontInfo);
}
@@ -252,11 +261,12 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
*/
private static void addFontInfoListFromFileList(
List fontFileList, List/*<EmbedFontInfo>*/ embedFontInfoList,
- FontResolver resolver, FontCache fontCache) {
+ FontResolver resolver, FontCache fontCache, FontEventListener listener) {
for (Iterator iter = fontFileList.iterator(); iter.hasNext();) {
URL fontUrl = (URL)iter.next();
// parse font to ascertain font info
FontInfoFinder finder = new FontInfoFinder();
+ finder.setEventListener(listener);
//EmbedFontInfo fontInfo = finder.find(fontUrl, resolver, fontCache);
//List<EmbedFontInfo> embedFontInfoList = finder.find(fontUrl, resolver, fontCache);
@@ -332,7 +342,8 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
* @throws FOPException if something's wrong with the config data
*/
private static EmbedFontInfo getFontInfoFromConfiguration(
- Configuration fontCfg, FontResolver fontResolver, boolean strict, FontCache fontCache)
+ Configuration fontCfg, FontResolver fontResolver, boolean strict,
+ FontCache fontCache, FontEventListener listener)
throws FOPException {
String metricsUrl = fontCfg.getAttribute("metrics-url", null);
String embedUrl = fontCfg.getAttribute("embed-url", null);
@@ -384,6 +395,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
}
if (fontFile != null) {
FontInfoFinder finder = new FontInfoFinder();
+ finder.setEventListener(listener);
EmbedFontInfo[] infos = finder.find(fontUrl, fontResolver, fontCache);
return infos[0]; //When subFont is set, only one font is returned
} else {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java
index 06dbaccd5..6694f0a7d 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFontManager.java
@@ -144,21 +144,22 @@ public final class RtfFontManager {
}
header.newLine();
- header.writeGroupMark (true);
- header.writeControlWord ("fonttbl;");
+ header.writeGroupMark(true);
+ header.writeControlWord("fonttbl");
int len = fontTable.size ();
for (int i = 0; i < len; i++) {
- header.writeGroupMark (true);
+ header.writeGroupMark(true);
header.newLine();
- header.write ("\\f" + i);
- header.write (" " + (String) fontTable.elementAt (i));
- header.writeGroupMark (false);
+ header.write("\\f" + i);
+ header.write(" " + (String) fontTable.elementAt (i));
+ header.write(";");
+ header.writeGroupMark(false);
}
header.newLine();
- header.writeGroupMark (false);
+ header.writeGroupMark(false);
}