*/
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);
}
<?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>
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.afp.fonts;
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,
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());
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;
/** {@inheritDoc} */
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();
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