-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
feat: text measurements based on font metrics #7693
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
749fd97 to
2ca2aff
Compare
63af989 to
2ca2aff
Compare
2ca2aff to
a704bf6
Compare
a88b96f to
5192efc
Compare
5192efc to
ce4835f
Compare
|
@Mrazator did some testing across browsers and it works very well ✨. The only issue that remains is LS in very High and low zoom levels which is in prod as well hence not a blocker for this PR. Additionally, can you confirm if all the test cases mentioned in this PR - #6187 (check Testing scenarios) works fine ? |
@ad1992 I am aware of certain existing issues when zoomed in completely, but not the other way around. For future reference, could you give an example of the mentioned LS when zoomed out completely? |
Based on the test cases I additionally found a horizontal shift, which is also in prod and unrelated to the baseline. Screen.Recording.2024-02-26.at.13.01.40.mov |
…unnecessary offset causing layout shifts
|
Awesome! Let's see what we break! 🔥 |
Hi there, I'm the author of the IntelliJ Excaldraw plugin (actualluy any Jetbrains IDE based on IJ). In my IDE I'm packaging the latest release 0.17.3, one of our user sketched some documents on excalidraw.com and opened them in the IJ plugin, however the text wasn't showing up, I discovered that the text elements didn't have the However, I believe by removing the baseline it break backward compatibility. Maybe that's expected. I could remediate the situation by upgrading excalidraw, but I'm not sure I should use the trunk version (nor if I can, I don't know if it's available in yarn, as I'm not a frontend dev I lack a lot of knowledge/skills in this area) |
|
Hi. That's right, you'd have to upgrade to latest, which isn't on stable yet, although you can install it from the
If nothing else, I'd upgrade to 0.17.6 which contains some security fixes. |
Interesting I wasn't aware there were newer versions, the last I saw was 0.17.3 in https://github.com/excalidraw/excalidraw/releases.
That said I wonder if that's a good idea for the plugin as not everything might be ironed out. Given my poor skills in TS / JS, I'd rather hold off the next stable version hopefully soon (but I know how it is with OSS, when it's ready :) ). |
TLDR; Following is the continuation of #7669 moving away from imprecise (integer-based) canvas-text metrics into the relative font metrics encoded within the font itself (read by https://opentype.js.org/font-inspector.html).
Business value:
Technical details:
Todo:
baselinepropRelated issues:
imageSmoothingEnabledon/off didn't have any effect. Noticeable mostly on lower PPI withdevicePixelRatio == 1.Comparison:
Resizing.mov
Layout.shift.mov