remove couts

This commit is contained in:
jrkb 2023-04-06 11:16:21 +02:00
parent 971a9f089d
commit c0de84ab00

View file

@ -80,7 +80,6 @@ void Atlas::setup(string _fontPath,
}
void Atlas::addVariations(vector <FontVariation> variations){
cout << __LINE__ << endl;
// add to extremes
for(const auto & variation : variations){
auto & v = variationExtremes;
@ -97,54 +96,37 @@ void Atlas::addVariations(vector <FontVariation> variations){
cout << "variation " << variation.name << " v:" << variation.value << endl;
}
}
cout << __LINE__ << endl;
// calculate steps
variationSteps.clear();
// first, sort the extremes
sort(variationExtremes.begin(),
variationExtremes.end(),
compareFontVariations);
cout << __LINE__ << endl;
for(int i = 0; i < variationExtremes.size() - 1; i++){
cout << __LINE__ << endl;
const FontVariation & a = variationExtremes[i];
cout << __LINE__ << endl;
const FontVariation & b = variationExtremes[i + 1];
cout << __LINE__ << endl;
cout << "a value: " << ofToString(a.value) << endl;
cout << "b value: " << ofToString(b.value) << endl;
float diff = b.value - a.value;
cout << "diff: " << ofToString(diff) << endl;
cout << __LINE__ << endl;
int stepAmount = ceil(diff / settings.maxInterpolationStepSize);
cout << "stepAmount: " << ofToString(stepAmount) << endl;
cout << __LINE__ << endl;
float step = diff / stepAmount;
float value = a.value + step;
cout << __LINE__ << endl;
variationSteps.push_back(a);
cout << "ADDING " << a.name << " (" << ofToString(a.value) << ")" << endl;
int stop = 0;
cout << __LINE__ << endl;
while(value < b.value && stop < 100){
variationSteps.push_back({a.name, value});
cout << std::fixed << "ADDING " << a.name << " (" << value << ")" << endl;
value += step;
cout << __LINE__ << endl;
stop++;
}
cout << "ADDING " << b.name << " (" << ofToString(b.value) << ")" << endl;
variationSteps.push_back(b);
}
cout << __LINE__ << endl;
if(variationExtremes.size() == 1){
variationSteps = variationExtremes;
}
cout << __LINE__ << endl;
}
bool Atlas::generate(){
cout << "Atlas::generate()" << endl;
bool success = false;
//{
if(ft){
@ -198,8 +180,6 @@ bool Atlas::generate(){
glyphs.insert(glyphs.end(),
variationGlyphs.begin(),
variationGlyphs.end());
}
// Apply MSDF edge coloring. See edge-coloring.h for other coloring strategies.
for(msdf_atlas::GlyphGeometry & glyph : glyphs){