-
Notifications
You must be signed in to change notification settings - Fork 130
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
Util function getCaretAtPoint can't get the uniform text caret vertical position for number/character and Chinese text. #294
Comments
Thanks for the report! The caretTop and caretHeight are calculated here -- the difference is due to the Latin and Chinese font files containing different ascender/descender metrics. I'm open to changing how those values are chosen, if you know of a good reliable method that would make them match. As for your example, I think keeping it external is best, it can stay on Stackblitz and maybe we can add a link to it in the documentation. |
I will append the demo link into the doc soon, and by the way, do u know how to calculate the font length before text.sync, i want to draw some lines and dots based on text length before drawing troika text😂😂 |
https://stackblitz.com/edit/vitejs-vite-xq3mug?file=package.json,src%2Fmain.js, click this link, and click the text in the scene, you will find get different vertical position for number/character and Chinese text. The compareing screentshot as below:
number or character:
Chinese text:
The text was updated successfully, but these errors were encountered: