Open BreyerW opened 4 years ago
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
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.