remove couts
This commit is contained in:
parent
971a9f089d
commit
c0de84ab00
1 changed files with 1 additions and 21 deletions
|
@ -80,7 +80,6 @@ void Atlas::setup(string _fontPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Atlas::addVariations(vector <FontVariation> variations){
|
void Atlas::addVariations(vector <FontVariation> variations){
|
||||||
cout << __LINE__ << endl;
|
|
||||||
// add to extremes
|
// add to extremes
|
||||||
for(const auto & variation : variations){
|
for(const auto & variation : variations){
|
||||||
auto & v = variationExtremes;
|
auto & v = variationExtremes;
|
||||||
|
@ -97,54 +96,37 @@ void Atlas::addVariations(vector <FontVariation> variations){
|
||||||
cout << "variation " << variation.name << " v:" << variation.value << endl;
|
cout << "variation " << variation.name << " v:" << variation.value << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << __LINE__ << endl;
|
|
||||||
// calculate steps
|
// calculate steps
|
||||||
variationSteps.clear();
|
variationSteps.clear();
|
||||||
// first, sort the extremes
|
// first, sort the extremes
|
||||||
sort(variationExtremes.begin(),
|
sort(variationExtremes.begin(),
|
||||||
variationExtremes.end(),
|
variationExtremes.end(),
|
||||||
compareFontVariations);
|
compareFontVariations);
|
||||||
cout << __LINE__ << endl;
|
|
||||||
|
|
||||||
for(int i = 0; i < variationExtremes.size() - 1; i++){
|
for(int i = 0; i < variationExtremes.size() - 1; i++){
|
||||||
cout << __LINE__ << endl;
|
|
||||||
const FontVariation & a = variationExtremes[i];
|
const FontVariation & a = variationExtremes[i];
|
||||||
cout << __LINE__ << endl;
|
|
||||||
const FontVariation & b = variationExtremes[i + 1];
|
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;
|
float diff = b.value - a.value;
|
||||||
cout << "diff: " << ofToString(diff) << endl;
|
|
||||||
cout << __LINE__ << endl;
|
cout << __LINE__ << endl;
|
||||||
int stepAmount = ceil(diff / settings.maxInterpolationStepSize);
|
int stepAmount = ceil(diff / settings.maxInterpolationStepSize);
|
||||||
cout << "stepAmount: " << ofToString(stepAmount) << endl;
|
|
||||||
cout << __LINE__ << endl;
|
|
||||||
float step = diff / stepAmount;
|
float step = diff / stepAmount;
|
||||||
float value = a.value + step;
|
float value = a.value + step;
|
||||||
cout << __LINE__ << endl;
|
|
||||||
variationSteps.push_back(a);
|
variationSteps.push_back(a);
|
||||||
cout << "ADDING " << a.name << " (" << ofToString(a.value) << ")" << endl;
|
|
||||||
int stop = 0;
|
int stop = 0;
|
||||||
cout << __LINE__ << endl;
|
|
||||||
while(value < b.value && stop < 100){
|
while(value < b.value && stop < 100){
|
||||||
variationSteps.push_back({a.name, value});
|
variationSteps.push_back({a.name, value});
|
||||||
cout << std::fixed << "ADDING " << a.name << " (" << value << ")" << endl;
|
|
||||||
value += step;
|
value += step;
|
||||||
cout << __LINE__ << endl;
|
|
||||||
stop++;
|
stop++;
|
||||||
}
|
}
|
||||||
cout << "ADDING " << b.name << " (" << ofToString(b.value) << ")" << endl;
|
|
||||||
variationSteps.push_back(b);
|
variationSteps.push_back(b);
|
||||||
}
|
}
|
||||||
cout << __LINE__ << endl;
|
|
||||||
if(variationExtremes.size() == 1){
|
if(variationExtremes.size() == 1){
|
||||||
variationSteps = variationExtremes;
|
variationSteps = variationExtremes;
|
||||||
}
|
}
|
||||||
cout << __LINE__ << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Atlas::generate(){
|
bool Atlas::generate(){
|
||||||
|
cout << "Atlas::generate()" << endl;
|
||||||
bool success = false;
|
bool success = false;
|
||||||
//{
|
//{
|
||||||
if(ft){
|
if(ft){
|
||||||
|
@ -198,8 +180,6 @@ bool Atlas::generate(){
|
||||||
glyphs.insert(glyphs.end(),
|
glyphs.insert(glyphs.end(),
|
||||||
variationGlyphs.begin(),
|
variationGlyphs.begin(),
|
||||||
variationGlyphs.end());
|
variationGlyphs.end());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// Apply MSDF edge coloring. See edge-coloring.h for other coloring strategies.
|
// Apply MSDF edge coloring. See edge-coloring.h for other coloring strategies.
|
||||||
for(msdf_atlas::GlyphGeometry & glyph : glyphs){
|
for(msdf_atlas::GlyphGeometry & glyph : glyphs){
|
||||||
|
|
Loading…
Reference in a new issue