Author: ssteiner
Date: Tue Jul 21 13:34:17 2020
New Revision: 1880107

URL: http://svn.apache.org/viewvc?rev=1880107&view=rev
Log:
FOP-2958: Error when using both AFP truetype and base14 font

Modified:
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java
    
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPTrueTypeTestCase.java

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java?rev=1880107&r1=1880106&r2=1880107&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java
 Tue Jul 21 13:34:17 2020
@@ -283,10 +283,12 @@ public final class ActiveEnvironmentGrou
     private MapCodedFont getCurrentMapCodedFont() {
         int size = mapCodedFonts.size();
         if (size > 0) {
-            return (MapCodedFont)mapCodedFonts.get(size - 1);
-        } else {
-            return null;
+            AbstractStructuredObject font = mapCodedFonts.get(size - 1);
+            if (font instanceof MapCodedFont) {
+                return (MapCodedFont) font;
+            }
         }
+        return null;
     }
 
     /**

Modified: 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPTrueTypeTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPTrueTypeTestCase.java?rev=1880107&r1=1880106&r2=1880107&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPTrueTypeTestCase.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/render/afp/AFPTrueTypeTestCase.java
 Tue Jul 21 13:34:17 2020
@@ -82,6 +82,7 @@ public class AFPTrueTypeTestCase {
                 + "  <fo:page-sequence master-reference=\"simple\">\n"
                 + "    <fo:flow flow-name=\"xsl-region-body\">\n"
                 + "      <fo:block 
font-family=\"Univers\">Univers</fo:block>\n"
+                + "      <fo:block font-family=\"Times\">Times</fo:block>\n"
                 + "    </fo:flow>\n"
                 + "  </fo:page-sequence>\n"
                 + "</fo:root>";
@@ -99,8 +100,10 @@ public class AFPTrueTypeTestCase {
                 + "BEGIN PAGE_GROUP PGP00001\n"
                 + "BEGIN PAGE PGN00001\n"
                 + "BEGIN ACTIVE_ENVIRONMENT_GROUP AEG00001\n"
-                + "MAP DATA_RESOURCE Triplets: 
0x01,FULLY_QUALIFIED_NAME,FULLY_QUALIFIED_NAME"
-                + ",OBJECT_CLASSIFICATION,DATA_OBJECT_FONT_DESCRIPTOR,\n"
+                + "MAP DATA_RESOURCE Triplets: 
0x01,FULLY_QUALIFIED_NAME,FULLY_QUALIFIED_NAME,OBJECT_CLASSIFICATION,"
+                + "DATA_OBJECT_FONT_DESCRIPTOR,\n"
+                + "MAP CODED_FONT Triplets: 
FULLY_QUALIFIED_NAME,FULLY_QUALIFIED_NAME,CHARACTER_ROTATION,"
+                + "RESOURCE_LOCAL_IDENTIFIER,\n"
                 + "DESCRIPTOR PAGE\n"
                 + "MIGRATION PRESENTATION_TEXT\n"
                 + "END ACTIVE_ENVIRONMENT_GROUP AEG00001\n"
@@ -164,6 +167,12 @@ public class AFPTrueTypeTestCase {
                 + "          <font-triplet name=\"Univers\" style=\"normal\" 
weight=\"normal\"/>\n"
                 + "          <font-triplet name=\"any\" style=\"normal\" 
weight=\"normal\"/>\n"
                 + "        </font>\n"
+                + "        <font>\n"
+                + "          <afp-font name=\"Times Roman\" type=\"raster\" 
codepage=\"T1V10500\" encoding=\"Cp500\">\n"
+                + "            <afp-raster-font size=\"12\" 
characterset=\"C0N200B0\" base14-font=\"TimesRoman\"/>\n"
+                + "          </afp-font>\n"
+                + "          <font-triplet name=\"Times\" style=\"normal\" 
weight=\"normal\"/>\n"
+                + "        </font>"
                 + "      </fonts>\n"
                 + "    </renderer>\n"
                 + "  </renderers>\n"



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org

Reply via email to