-
Notifications
You must be signed in to change notification settings - Fork 63
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
Linebreaking #76
base: master
Are you sure you want to change the base?
Linebreaking #76
Conversation
@brawer Can you test this, it should be more stable now. One important change in the client code is to use |
9054ec3
to
67e38f5
Compare
Only glyph advance affects line width.
The ascender and descender members of FT_Face are in font units, but we want then in pixel size. Also, the first should be moved down by the ascender.
Should not enter into infinite loops now.
Our own implementation is based on: http://unicode.org/Public/PROGRAMS/LineBreakSampleCpp/ Which right there it says this is outdated and does not support the algorithm after Unicode 5.2. Further more the code was even more broken as there is mismatch between the number of break classes supported by UCDN abd that outdated code, which was resulting in out of bounds array access, fun!
6ec5086
to
d2efc62
Compare
Testing absolute positions seems to be sensitive to FreeType version.
d2efc62
to
bcaacf1
Compare
bcaacf1
to
3b00a74
Compare
After more thought, layout is very application dependent, so even if this is merged, one might not able to use it directly without modification. |
@molikto could you give an example on why extra application logic is needed to determine the line breaks? |
Hello, |
seems that it is better to do in stk level anyway... btw is there some way to tell inside a glyph there is character in cluster breakable? For example "ff" or "fl" |
No
No one is currently working on this code and it isn’t very well tested either. |
Not sure I get the question, can you elaborate on what you are trying to do. |
sorry bad english, i was trying for "cursor movement" in editbox, for example if i press left button around the "fi" glyph, is there some way to tell it should stop between f and i in the glyph? Because we are using old editbox in stk which has no text shaping (it assumes 1 word per glyph) |
also because i need to take emoji glyph into account(which i think it should be taken as 1 word, for example 2 letter country flag) |
You can use harfbuzz cluster value for that purpose https://harfbuzz.github.io/clusters.html#clusters-and-shaping |
For drawing the cursor, you can use |
No description provided.