diff options
author | Simon Steiner <ssteiner@apache.org> | 2022-10-27 07:07:25 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2022-10-27 07:07:25 +0000 |
commit | ba8239511e7051aae29199a6e250aaebdd1ecc43 (patch) | |
tree | 702aae3913b3fd698e8737fbd1eb266505a654e5 /fop-core/src | |
parent | b7dbb81fcf37b80b3ca83ca254383398ddd162e6 (diff) | |
download | xmlgraphics-fop-ba8239511e7051aae29199a6e250aaebdd1ecc43.tar.gz xmlgraphics-fop-ba8239511e7051aae29199a6e250aaebdd1ecc43.zip |
FOP-3101: Don't break with hangul syllables
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1904866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java | 10 | ||||
-rw-r--r-- | fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java | 8 |
2 files changed, 15 insertions, 3 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java b/fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java index 157a480cc..4ecc54104 100644 --- a/fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java +++ b/fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java @@ -170,6 +170,16 @@ public class LineBreakStatus { hadSpace = true; return PROHIBITED_BREAK; + case LineBreakUtils.LINE_BREAK_PROPERTY_JL: + case LineBreakUtils.LINE_BREAK_PROPERTY_JV: + case LineBreakUtils.LINE_BREAK_PROPERTY_H2: + case LineBreakUtils.LINE_BREAK_PROPERTY_H3: + // LB 26: Do not break a Korean syllable. + if (!hadSpace) { + return PROHIBITED_BREAK; + } + break; + default: //nop } diff --git a/fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java b/fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java index e4854d9a7..279c2f7fc 100644 --- a/fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java @@ -41,7 +41,6 @@ public class LineBreakStatusTestCase { */ @Test public void testReset() { - System.out.println("testReset"); // TODO } @@ -51,8 +50,6 @@ public class LineBreakStatusTestCase { */ @Test public void testNextChar() { - System.out.println("testNextChar"); - // AL -- Ordinary Alphabetic and Symbol Characters (XP) assertTrue(testBreak( "Nobreak", @@ -309,6 +306,11 @@ public class LineBreakStatusTestCase { "^^" + "^" + "^^^^^" )); + // hangul syllables + assertTrue(testBreak( + "Simple" + "\uAC00" + "break", + "^^^^^^" + "^" + "^^^^^" + )); } /** |