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

Typography.MsdfGen lacks convenient shape generator from glyph #182

Open
BreyerW opened this issue Dec 20, 2019 · 1 comment
Open

Typography.MsdfGen lacks convenient shape generator from glyph #182

BreyerW opened this issue Dec 20, 2019 · 1 comment

Comments

@BreyerW
Copy link

BreyerW commented Dec 20, 2019

Basically title. Without helper that would take glyph directly or just endpoints and glyph points and return shape Typography.MsdfGen is unusable at least for me.

@Tacodiva
Copy link

Hey,
In case anyone else is interested, I've been working on a game engine and wanted to be able to generate SDFs at runtime and I managed to hook up the font loader and MsdfGen without any PixelFarm stuff. You can see my fork here on how it's done, but essentially I've created some wrappers around this libraries objects for my specific usecase.

TypefaceWrapper typeface = TypefaceWrapper.Load(new FileStream(...));
GlyphWrapper glyph = typeface.GetGlyph('&');
MsdfgenResult result = glyph.RenderMSDF(glyphSizePixels: 40, range: 10, paddingPixels: 3);
// Result contains the FloatRGBBmp object and a vector containing how much the glyph has been translated in pixels 

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