Author: jeremias
Date: Tue Apr 14 14:20:28 2009
New Revision: 764785
URL: http://svn.apache.org/viewvc?rev=764785&view=rev
Log:
Strange, this change didn't get merged over. Not sure why.
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFUtil.java
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFUtil.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFUtil.java?rev=764785&r1=764784&r2=764785&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFUtil.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/render/intermediate/IFUtil.java
Tue Apr 14 14:20:28 2009
@@ -153,6 +153,13 @@
if (fontInfo == null) {
fontInfo = new FontInfo();
}
+ if (documentHandler instanceof IFSerializer) {
+ IFSerializer serializer = (IFSerializer)documentHandler;
+ if (serializer.getMimickedDocumentHandler() != null) {
+ //Use the mimicked document handler's configurator to set up
fonts
+ documentHandler = serializer.getMimickedDocumentHandler();
+ }
+ }
IFDocumentHandlerConfigurator configurator =
documentHandler.getConfigurator();
if (configurator != null) {
configurator.setupFontInfo(documentHandler, fontInfo);
@@ -172,4 +179,21 @@
setupFonts(documentHandler, null);
}
+ /**
+ * Returns the MIME type of the output format that the given document
handler is supposed to
+ * handle. If the document handler is an {...@link IFSerializer} it
returns the MIME type of the
+ * document handler it is mimicking.
+ * @param documentHandler the document handler
+ * @return the effective MIME type
+ */
+ public static String getEffectiveMIMEType(IFDocumentHandler
documentHandler) {
+ if (documentHandler instanceof IFSerializer) {
+ IFDocumentHandler mimic =
((IFSerializer)documentHandler).getMimickedDocumentHandler();
+ if (mimic != null) {
+ return mimic.getMimeType();
+ }
+ }
+ return documentHandler.getMimeType();
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]