Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combing characters are broken in the Unicode example in the README. #312

Open
7ombie opened this issue Jun 22, 2023 · 1 comment
Open

Combing characters are broken in the Unicode example in the README. #312

7ombie opened this issue Jun 22, 2023 · 1 comment

Comments

@7ombie
Copy link

7ombie commented Jun 22, 2023

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):

80055786-95e43580-84f0-11ea-86dd-8dfb7f062b39

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.

@migueldeicaza
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants