Author: acumiskey
Date: Tue Jul 29 10:14:25 2008
New Revision: 680777
URL: http://svn.apache.org/viewvc?rev=680777&view=rev
Log:
* Provide warning message if no "any" font family is configured.
* When no configuration is provided, the fallback "any" base 12 font mapping is
to "Times" (so as to be consistent) with the base 14 fonts and not Helvetica
(as previously).
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPBase12FontCollection.java
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.java?rev=680777&r1=680776&r2=680777&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.java
(original)
+++
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.java
Tue Jul 29 10:14:25 2008
@@ -60,4 +60,12 @@
*/
void warnDefaultFontSetup(Object source);
+ /**
+ * Warn about a missing default "any" font configuration.
+ * @param source the event source
+ * @param style the font style
+ * @param weight the font weight
+ * @event.severity WARN
+ */
+ void warnMissingDefaultFont(Object source, String style, int weight);
}
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.xml?rev=680777&r1=680776&r2=680777&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
(original)
+++
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPEventProducer.xml
Tue Jul 29 10:14:25 2008
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
<message
key="org.apache.fop.render.afp.AFPEventProducer.warnDefaultFontSetup">No AFP
fonts configured. Using default setup.</message>
+ <message
key="org.apache.fop.render.afp.AFPEventProducer.warnMissingDefaultFont">No AFP
default "any", {style}, {weight} font configured.</message>
</catalogue>
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPBase12FontCollection.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPBase12FontCollection.java?rev=680777&r1=680776&r2=680777&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPBase12FontCollection.java
(original)
+++
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPBase12FontCollection.java
Tue Jul 29 10:14:25 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.afp.fonts;
@@ -79,13 +79,12 @@
RasterFont font = null;
/** standard font family reference names for Helvetica font */
- final String[] helveticaNamesPlusAny = {"Helvetica", "Arial",
"sans-serif", "any"};
+ final String[] helveticaNames = {"Helvetica", "Arial", "sans-serif"};
font = new RasterFont("Helvetica");
addCharacterSet(font, "C0H200", new Helvetica());
- num = addFontProperties(fontInfo, font, helveticaNamesPlusAny,
+ num = addFontProperties(fontInfo, font, helveticaNames,
Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, num);
- final String[] helveticaNames = {"Helvetica", "Arial", "sans-serif"};
font = new RasterFont("Helvetica Italic");
addCharacterSet(font, "C0H300", new HelveticaOblique());
num = addFontProperties(fontInfo, font, helveticaNames,
@@ -102,8 +101,11 @@
Font.STYLE_ITALIC, Font.WEIGHT_BOLD, num);
+ /** standard font family reference names for Times font */
+
+ /** any is treated as serif */
final String[] timesNames = {"Times", "TimesRoman", "Times Roman",
"Times-Roman",
- "Times New Roman", "TimesNewRoman", "serif"};
+ "Times New Roman", "TimesNewRoman", "serif", "any"};
font = new RasterFont("Times Roman");
addCharacterSet(font, "CON200", new TimesRoman());
Modified:
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java?rev=680777&r1=680776&r2=680777&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java
(original)
+++
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/AFPFontCollection.java
Tue Jul 29 10:14:25 2008
@@ -23,6 +23,7 @@
import java.util.List;
import org.apache.fop.events.EventBroadcaster;
+import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontCollection;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontTriplet;
@@ -52,6 +53,7 @@
/** [EMAIL PROTECTED] */
public int setup(int start, FontInfo fontInfo) {
int num = 1;
+ AFPEventProducer eventProducer =
AFPEventProducer.Provider.get(eventBroadcaster);
if (fontInfoList != null && fontInfoList.size() > 0) {
for (Iterator it = fontInfoList.iterator(); it.hasNext();) {
AFPFontInfo afpFontInfo = (AFPFontInfo)it.next();
@@ -65,8 +67,19 @@
num++;
}
}
+ if (fontInfo.fontLookup("any", Font.STYLE_NORMAL,
Font.WEIGHT_NORMAL) == null) {
+ eventProducer.warnMissingDefaultFont(this, Font.STYLE_NORMAL,
Font.WEIGHT_NORMAL);
+ }
+ if (fontInfo.fontLookup("any", Font.STYLE_ITALIC,
Font.WEIGHT_NORMAL) == null) {
+ eventProducer.warnMissingDefaultFont(this, Font.STYLE_ITALIC,
Font.WEIGHT_NORMAL);
+ }
+ if (fontInfo.fontLookup("any", Font.STYLE_NORMAL,
Font.WEIGHT_BOLD) == null) {
+ eventProducer.warnMissingDefaultFont(this, Font.STYLE_ITALIC,
Font.WEIGHT_BOLD);
+ }
+ if (fontInfo.fontLookup("any", Font.STYLE_ITALIC,
Font.WEIGHT_BOLD) == null) {
+ eventProducer.warnMissingDefaultFont(this, Font.STYLE_ITALIC,
Font.WEIGHT_BOLD);
+ }
} else {
- AFPEventProducer eventProducer =
AFPEventProducer.Provider.get(eventBroadcaster);
eventProducer.warnDefaultFontSetup(this);
// Go with a default base 12 configuration for AFP environments
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]