View Issue Details

IDProjectCategoryView StatusLast Update
0004007NoesisGUIC# SDKpublic2025-03-26 18:43
ReporterJinFox Assigned Tojsantos  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Product Version3.2 
Target Version3.2.8 
Summary0004007: Allowing Per word Wrapping in Korean
Description

This ticket is linked to the forum post regarding word wrapping in Korean (Hangul glyphs) being by Character and not per word :
Here is the link to the forum post where the issue is explained in detail : https://www.noesisengine.com/forums/viewtopic.php?p=18361

Could you add a way for us to select the type of wrapping for textblocks in korean.

Thank you!

PlatformAny

Activities

jsantos

jsantos

2025-03-26 18:42

manager   ~0010428

Please, use the following patch

Index: LineBreaking.cpp

--- LineBreaking.cpp (revision 15297)
+++ LineBreaking.cpp (working copy)
@@ -113,6 +113,14 @@
{ DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK } // CB
};

+// https://www.unicode.org/reports/tr14/#Examples
+// Depending on the nature of the document, Korean either uses implicit breaking around characters
+// (type 2 as defined in Section 3, Introduction) or uses spaces (type 1). Space-based layout is
+// common in magazines and other informal documents with ragged margins, while books, with both
+// margins justified, use the other type, as it affords more line break opportunities and therefore
+// leads to better justification.
+#define HANGUL_TEXT_WRAPPING_PER_WORD 1
+
////////////////////////////////////////////////////////////////////////////////////////////////////
static uint8_t GetType(uint32_t ch)
{
@@ -126,14 +134,26 @@
{
case LBT_AI:
return LBT_AL;
+
case LBT_CJ:
// "Strict" line breaking
// http://www.unicode.org/reports/tr14/#CJ
return LBT_NS;
+
case LBT_SA:
case LBT_SG:
case LBT_XX:
return LBT_AL;
+

  • #if HANGUL_TEXT_WRAPPING_PER_WORD
  • case LBT_H2:
  • case LBT_H3:
  • case LBT_JL:
  • case LBT_JV:
  • case LBT_JT:
  • return LBT_AL;
  • #endif
  •  default:
         return type;

    }

jsantos

jsantos

2025-03-26 18:43

manager   ~0010429

Fixed in r15367

Issue History

Date Modified Username Field Change
2025-03-25 09:30 JinFox New Issue
2025-03-26 18:40 jsantos Assigned To => jsantos
2025-03-26 18:40 jsantos Status new => assigned
2025-03-26 18:40 jsantos Target Version => 3.2.8
2025-03-26 18:42 jsantos Note Added: 0010428
2025-03-26 18:43 jsantos Status assigned => resolved
2025-03-26 18:43 jsantos Resolution open => fixed
2025-03-26 18:43 jsantos Note Added: 0010429