Skip to content

Commit 8736bba

Browse files
FOP-3278: Escape codepoint for SVG in PS
1 parent 63e8425 commit 8736bba

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

fop-core/src/main/java/org/apache/fop/render/ps/PSTextPainter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ private void paintStrokedGlyphs(PSGraphics2D g2d, TextUtil textUtil,
447447
gen.write(">");
448448
} else {
449449
char codepoint = (char) (mapped % 256);
450-
gen.write("(" + codepoint + ")");
450+
StringBuffer sb = new StringBuffer();
451+
PSGenerator.escapeChar(codepoint, sb);
452+
gen.write("(" + sb.toString() + ")");
451453
}
452454
gen.writeln(" false charpath");
453455

fop-core/src/test/java/org/apache/fop/svg/PSTextPainterTestCase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,12 @@ public void testWatermark() throws Exception {
8181
OutputStream os = g2d.getPSGenerator().getOutputStream();
8282
Assert.assertFalse(os.toString().contains("( ) false charpath"));
8383
}
84+
85+
@Test
86+
public void testBullet() throws Exception {
87+
PSGraphics2D g2d = (PSGraphics2D) runTest("bullet.svg",
88+
new OperatorValidator().addOperatorMatch("GS", "GS"));
89+
OutputStream os = g2d.getPSGenerator().getOutputStream();
90+
Assert.assertTrue(os.toString().contains("(\\267) false charpath"));
91+
}
8492
}
Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)