Explorar el Código

Slight correction: single quoted font-family names not properly handled

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@377242 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_92-beta
Andreas L. Delmelle hace 18 años
padre
commit
045fc2577c

+ 6
- 0
src/java/org/apache/fop/fo/properties/FontShorthandProperty.java Ver fichero

@@ -101,6 +101,11 @@ public class FontShorthandProperty extends ListProperty {
/* no list, just a single name
* (or first name in the list)
*/
if (quoteIndex != -1) {
/* a single name, quoted
*/
fromIndex = quoteIndex;
}
m = FObj.getPropertyMakerFor(PROP_IDS[1]);
prop = m.make(propertyList, specVal.substring(fromIndex), fo);
newProp.addProperty(prop, 1);
@@ -112,6 +117,7 @@ public class FontShorthandProperty extends ListProperty {
* fromIndex = index of the first quote
*/
fromIndex = quoteIndex;
quoteIndex = -1;
} else {
fromIndex = value.lastIndexOf(' ', commaIndex) + 1;
}

+ 3
- 3
test/fotree/testcases/font-shorthand-test.fo Ver fichero

@@ -23,10 +23,10 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:flow flow-name="xsl-region-body">
<fo:block font="10pt sans-serif">
<test:assert property="font-family" expected="[sans-serif]"/>
<fo:block font="bold 10pt 'Times New Roman'">
<test:assert property="font-family" expected="[Times New Roman]"/>
<test:assert property="font-size" expected="10000mpt"/>
<test:assert property="font-weight" expected="400" />
<test:assert property="font-weight" expected="700" />
<test:assert property="font-style" expected="NORMAL" />
<test:assert property="line-height.optimum" expected="120.0%" />
<test:assert property="font-variant" expected="NORMAL" />

Cargando…
Cancelar
Guardar