zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
2.56k stars 179 forks source link

Grapheme Cluster Boundary #391

Closed zufuliu closed 2 years ago

zufuliu commented 2 years ago

See https://sourceforge.net/p/scintilla/feature-requests/1417/ and https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries, without this some text (combining characters, emoji sequences, Hangul syllables, etc.) may not be rendered correctly.

Current source contains a simplified implementation (not enabled), for people who need this function (before implemented in Scintilla), please follow following steps:

  1. install Python 3.9 or later
  2. download following Unicode property files and put them into scintilla\scripts folder: a. https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt b. https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt c. https://www.unicode.org/Public/emoji/latest/emoji-zwj-sequences.txt d. https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt
  3. go to scintilla\scripts folder, run GenerateGraphemeBreak.py, which will generate scintilla\src\GraphemeBreak.h
  4. open scintilla\src\Document.cxx, search GraphemeBreak, enable related line and code block
  5. build the project

However, when word wrapping is enabled (the default), Unicode Line Breaking is also needed (issue #61), which requires large changes in Scintilla.

zufuliu commented 2 years ago

Enabled by 47aa9bf15d986fd7009a2a4108c0856ac1badf1e.