-
Hi, I am trying this nice lib in my project. I am able to generate a font atlas for a particular ttf file, std::vector<GlyphBox> boxes = generator.getLayout() the first GlyphBox in the vector has all values of bounds and rect to zeros. I tried with different font files, same problem my code to generate atlas : int num_loaded = fontGeometry.loadCharset(font, 2.0, Charset::ASCII); //return 95, which is right I think
const double maxCornerAngle = 3.0;
for (GlyphGeometry &glyph : glyphs)
{
glyph.edgeColoring(&msdfgen::edgeColoringInkTrap, maxCornerAngle, 0);
}
TightAtlasPacker packer;
packer.setMinimumScale(24.0);
packer.setPixelRange(2.0);
packer.setMiterLimit(1.0);
packer.pack(glyphs.data(), glyphs.size());
int width = 0, height = 0;
packer.getDimensions(width, height);
ImmediateAtlasGenerator< float, 3, &msdfGenerator, BitmapAtlasStorage<byte, 3> > generator(width, height);
GeneratorAttributes attributes;
generator.setAttributes(attributes);
generator.setThreadCount(4);
generator.generate(glyphs.data(), glyphs.size());
auto layout = generator.getLayout();
for(const auto& box : layout)
{
std::cout << box;
} |
Beta Was this translation helpful? Give feedback.
Answered by
gui2one
May 23, 2023
Replies: 1 comment
-
Oh .... I fell dumb ... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gui2one
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh .... I fell dumb ...
This is the SPACE glyph isn't it ?....