https://issues.apache.org/bugzilla/show_bug.cgi?id=44828
Summary: Font Family names with digits in them cause Batik to
throw exception
Product: Batik
Version: 1.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: CSS
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
SVG snippet like the following:
<text>
<tspan font-size="0.5in" x="1in" y="251in" font-family="Avenir LT 35
Light">Avenir LT 35 Light : lte50336.ttf</tspan>
<tspan font-size="0.5in" x="1in" y="252in" font-family="Avenir LT 35 Light">
The Quick Red Fox Jumped Over The Lazy Dog
</tspan>
</text>
Will cause batik to throw the following exception:
org.w3c.dom.DOMException:
file:/home/djoyce/Desktop/Batik_Font_Testing/fonts/fontsampler.svg:
The attribute "font-family" represents an invalid CSS value ("Avenir LT 35
Light").
Original message:
The "font-family" property does not support integer values.
at
org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(CSSEngine.java:784)
at
org.apache.batik.css.engine.CSSEngine.getComputedStyle(CSSEngine.java:876)
at
org.apache.batik.bridge.CSSUtilities.getComputedStyle(CSSUtilities.java:82)
at
org.apache.batik.bridge.CSSUtilities.convertDisplay(CSSUtilities.java:564)
at
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(SVGTextElementBridge.java:881)
at
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(SVGTextElementBridge.java:936)
at
org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(SVGTextElementBridge.java:856)
at
org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(SVGTextElementBridge.java:636)
at
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(SVGTextElementBridge.java:292)
at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:224)
at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
at
org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:96)
And instead of using the specified font, a default system font will be used.
Font Family names can contain punctuation AND numerical digits, batik needs to
properly handle these cases. This is the correct font family as reported by the
operating system. It seems batik is being a little too specific when verifying
attribute values for font-family.
>From the w3c:
http://www.w3.org/TR/REC-CSS2/fonts.html#font-family-prop
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]