Skip to content

Fonts were clipping for me so I added preloading#2

Open
heyJordanParker wants to merge 1 commit intoalexknowshtml:mainfrom
heyJordanParker:main
Open

Fonts were clipping for me so I added preloading#2
heyJordanParker wants to merge 1 commit intoalexknowshtml:mainfrom
heyJordanParker:main

Conversation

@heyJordanParker
Copy link

Writing this by hand like a dork, but yes.

Font size is hardcoded right now, which isn't ideal, but it does work so you might want it.

I'm using it alongside a modified version of your skill.

document.fonts.load() resolves when fonts are downloaded but canvas measureText() may still return fallback font metrics. Chain document.fonts.ready and verify with document.fonts.check() in a requestAnimationFrame retry loop before calling convertToExcalidrawElements.

Fixes text clipping in labeled shapes and standalone text elements.

document.fonts.load() resolves when fonts are downloaded but canvas
measureText() may still return fallback font metrics. Chain
document.fonts.ready and verify with document.fonts.check() in a
requestAnimationFrame retry loop before calling convertToExcalidrawElements.

Fixes text clipping in labeled shapes and standalone text elements.
@heyJordanParker
Copy link
Author

How they looked before:

Zen Twilight 2026-02-17 13 04 03

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

Successfully merging this pull request may close these issues.

1 participant