]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Slight correction: single quoted font-family names not properly handled
authorAndreas L. Delmelle <adelmelle@apache.org>
Sun, 12 Feb 2006 21:07:19 +0000 (21:07 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sun, 12 Feb 2006 21:07:19 +0000 (21:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@377242 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
test/fotree/testcases/font-shorthand-test.fo

index 75101c7708aaf400a7d60a8bc874c6e2d30014ce..3d1fa6604a937f535a52193a01fdb2712e639f0e 100644 (file)
@@ -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;
                             }
index 345161cf8046466441cf8a373aa3986d52d84504..e940e08d794695e382c04d832284aed03d0bcc1e 100644 (file)
   </fo:layout-master-set>\r
   <fo:page-sequence master-reference="simpleA4">\r
     <fo:flow flow-name="xsl-region-body">\r
-      <fo:block font="10pt sans-serif">\r
-        <test:assert property="font-family" expected="[sans-serif]"/>\r
+      <fo:block font="bold 10pt 'Times New Roman'">\r
+        <test:assert property="font-family" expected="[Times New Roman]"/>\r
         <test:assert property="font-size" expected="10000mpt"/>\r
-        <test:assert property="font-weight" expected="400" />\r
+        <test:assert property="font-weight" expected="700" />\r
         <test:assert property="font-style" expected="NORMAL" />\r
         <test:assert property="line-height.optimum" expected="120.0%" />\r
         <test:assert property="font-variant" expected="NORMAL" />\r