]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-3101: Don't break with hangul syllables
authorSimon Steiner <ssteiner@apache.org>
Thu, 27 Oct 2022 07:07:25 +0000 (07:07 +0000)
committerSimon Steiner <ssteiner@apache.org>
Thu, 27 Oct 2022 07:07:25 +0000 (07:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1904866 13f79535-47bb-0310-9956-ffa450edef68

fop-core/src/main/java/org/apache/fop/text/linebreak/LineBreakStatus.java
fop-core/src/test/java/org/apache/fop/text/linebreak/LineBreakStatusTestCase.java

index 157a480cc8bd341b6c2d413acb091acf9f22da3c..4ecc5410462b01107e40a36273aa28c327edd964 100644 (file)
@@ -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
         }
index e4854d9a7944558922b583ceb4613d1e1e1d7aca..279c2f7fcb46f5d29c816eb9023bf1318baa4fe1 100644 (file)
@@ -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",
+                "^^^^^^" + "^"    + "^^^^^"
+        ));
     }
 
     /**