-
Notifications
You must be signed in to change notification settings - Fork 52
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
Arabic Scripts #25
Comments
Yes, OpenType measuring was chosen for performance. Currently, both OpenType and the fallback canvas mechanism both use the char-by-char approach. However, I think it should be quite doable to use a multi-char measurement approach for canvas at least. For opentype, char-by-char could still work: it depends on what you're calling "merged characters" have a single unicode char value, and whether the font has a corresponding glyph for that char. Do you have an example? |
The way it works is that a character looks different if it's at the beginning, the middle, the end, or standalone (sort of like longhand writing). My understanding (I'm no expert) is the following: Each character is just a single unicode code point. The Font uses contextual OpenType features to choose what to render. I see that CodeMirror uses the DOM to measure text. Is that something you have considered too? |
I did consider that but a) I couldn't figure out the implementation :-), and b) I didn't spend too much time on it because I think it is a lot slower. For prosemirror that's probably ok but Ritzy needs these numbers a lot more often (because the surface layout is controlled completely by Ritzy). I could be wrong though. Probably worth trying out now that Prosemirror figured out the implementation. |
I know RTL languages are currently not supported, but just as a note for the
isOpenTypeJsReliable
function: The OpenType char-by-char approach is not viable for some scripts (like arabic), because characters are different depending on whether they are standalone, or merged together.Was the canvas measuring a speed concern, or why was the OpenType measuring mechanism chosen?
The text was updated successfully, but these errors were encountered: