SwiftTerm
SwiftTerm copied to clipboard
Combing characters are broken in the Unicode example in the README.
In the project README, it says "Solid UTF-8 support, excellent rendering". This is followed by a screenshot of SwiftTerm failing the first test (pretty badly):
The two-column text should be aligned with the bar characters in the ruler above, but it's not even close.
P.S. I commented about this on a different closed issue (#67), but have since deleted that comment and opened this issue instead.
Notes on the source of the problem:
This seems to be an issue with the handling of combining characters, the issue is characters like:
สิ
Are made up of "ส" and " ิ" (the latter being U+0E34) and should be considered in terms of the cell usage as part of the first cell.
The issue is that Swift is reporting that U+0E34 as a .notReordered value and prevents the combining code in handlePrint from running:
if firstScalar.properties.canonicalCombiningClass != .notReordered {
The letter rendering is correct, as CoreText sees both characters, but the cell positioning is wrong due to the wrong combining value being returned.