diff --git a/src/LayerComposition.cpp b/src/LayerComposition.cpp index 020414b..38b29af 100644 --- a/src/LayerComposition.cpp +++ b/src/LayerComposition.cpp @@ -8,6 +8,7 @@ void LayerComposition::setup(){ ofxMsdfgen::AtlasSettings settings; //settings.characters = "ABCDEFGHIJKL"; settings.scale = 64; + settings.characters = ""; //string fontName = "RobotoFlex.ttf"; //string fontPath = "data/fonts/" + fontName; //string fontPath = "data/celines-fonts/testing2VF.ttf"; @@ -15,10 +16,7 @@ void LayerComposition::setup(){ //string fontPath = "data/celines-fonts/Alfarn2.otf"; //string fontPath = "data/celines-fonts/Cottagecore.ttf"; atlas = make_shared (); - atlas->setup(fontPath, settings); - atlasImage = make_shared (atlas->getAtlasImage()); - glyphGeometries = atlas->getGlyphGeometries(); msdfShader = make_shared (); #ifdef TARGET_EMSCRIPTEN msdfShader->load("ofxMsdfgen/shaders/unitRange/ES3/shader"); @@ -32,8 +30,14 @@ void LayerComposition::setup(){ layer->setProps(Layer::Props()); + settings.characters += layer->getProps().text; layers.push_back(std::move(layer)); + atlas->setup(fontPath, settings); + atlas->generate(); + atlasImage = make_shared (atlas->getAtlasImage()); + glyphGeometries = atlas->getGlyphGeometries(); + } void LayerComposition::update(){