-
Notifications
You must be signed in to change notification settings - Fork 72
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
Rasterize a whole string #128
Comments
I ran into the same problem when trying to put text on opencv's I'd appreciate if anyone can share a solution for this, maybe something like |
I actually succeeded in rasterizing a string ! Wasn't too complicated, documentation was just somewhat lacking (and my own understanding of the topic is poor too). Check out this project for a concrete example https://github.com/Inspirateur/wordcloud-rs/blob/main/src/text.rs |
Rendering a string is tightly coupled to your render pipeline, which isn't something Ideally it is basically just make a layout, append your text to the layout, then iterate though layout.glyphs() and perform whatever operation you need to do on each glyph. Usually it's rasterizing them, caching them in an atlas, and generating sprites. I'll leave this issue open, I probably need some kind of example for a whole string if it's not clear in its current state. |
Hi, I'm making a wordcloud program and I'd like to be able to convert a whole string such as "Hello world" to a bitmap directly, like we can already do with individual chars.
Could this be added to fontdue ?
If this feature is out of scope for the library could you help me in implementing that ?
I'm lost in all the Layout and Metrics parameters and I'm not sure how to interpret them,
especially the negative xmin and ymin of Metrics.
The text was updated successfully, but these errors were encountered: