pyscripter / SynEdit

SynEdit is a syntax highlighting edit control, not based on the Windows common controls.
24 stars 11 forks source link

Better Unicode Handling #1

Closed pyscripter closed 1 year ago

pyscripter commented 5 years ago

There are three major issues with Unicode handling shown below:

A) Wide glyphs (e.g. Chinese characters) taking more space than other characters 爾雅爾雅爾雅爾雅爾雅爾雅

B) Surrogates pairs (two widechars correspond to one glyph) UTF-16 Encoding: 0xD83D 0xDCBC

C) Combining characters (more than one Widechars shown as one glyph) Åström ḱṷṓn Precomposed vrs Decomposed ḱṷṓn (U+1E31 U+1E77 U+1E53 U+006E) ḱṷṓn (U+006B U+0301 U+0075 U+032D U+006F U+0304 U+0301 U+006E)

SynEdit only deals with the first one but in a peculiar way (ExpandAtWideGlyphs)

pyscripter commented 1 year ago

Finished and committed the painting code to the DWrite branch. Sample output: image Chinese properly spaced, surrogate pairs and color emojis image Bidirectional text properly selected. image

pyscripter commented 1 year ago

See also https://en.delphipraxis.net/topic/6277-synedit-just-got-a-major-uplift/