Skip to content
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

Support for outlined text #176

Open
villuna opened this issue Jun 3, 2024 · 2 comments
Open

Support for outlined text #176

villuna opened this issue Jun 3, 2024 · 2 comments

Comments

@villuna
Copy link

villuna commented Jun 3, 2024

Hi there, I'm currently working on a game where I have to draw a lot of outlined text, so I would really like this crate to be able to draw and cache outlined glyphs. Would this be possible?

The only solution I've come up with is to use basic outline shader in post, but this isn't ideal as you have to apply the shader every time you draw new text, and that's pretty slow. (This is a big problem for me since I need to be able to draw new text potentially every frame)

@alexheretic
Copy link
Owner

There is currently no baked in support for drawing glyph outline effects.

It is possible to draw them with shader logic. Perhaps there are clever ways to write that shader? This approach is already possible and outside of glyph_brush scope.

Alternatively generate the offset outline lines/curves and feed them into ab_glyph_rasterizer to rasterize for caching into a texture you can draw underneath the regular glyphs. The crate can work with arbitrary outlines but generating them seems non-trivial. Related alexheretic/ab-glyph#75

@villuna
Copy link
Author

villuna commented Jun 3, 2024

I see. I'll see if I can find some other way to attack this problem then. Thanks for the suggestions.

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

No branches or pull requests

2 participants