void ofxTextCircleFill::setup(string fontPath, int minSize, int maxSize, int stepSize, float radius)
{
    if(stepSize <= 0){
        ofLog(OF_LOG_ERROR, "TxtDisplay: Size Step must be at least 1");
        stepSize = 1;
    }
    
    mRadius = radius;
    bSetMessage = false;
    bFontsLoaded = false;
    
    clearFonts();
    
    int numFontsLoaded = 0;

    for(int i = minSize; i <= maxSize; i += stepSize){
        ofTrueTypeFont* font = new ofTrueTypeFont();
        font->loadFont(fontPath, i, true, true, false);
        fonts[i] = font;
        
        numFontsLoaded++;
    }
    
    if(numFontsLoaded == 0){
        ofLog(OF_LOG_ERROR, "TxtDisplay: Did not load any fonts");
    }
    bFontsLoaded = true;
    
    mMinSize = minSize;
    mMaxSize = maxSize;
    mStepSize = stepSize;
    
}
Exemple #2
0
LibASS::~LibASS()
{
	closeASS();
	closeOSD();
	clearFonts();
	ass_library_done(ass);
}
Exemple #3
0
void FontManager::readFontMap(std::string path) {
	clearFonts();
	if (path.length()==0)
		path=path_font_cfg;
	auto doc = resourceHandler->xml.getResource(path_font_cfg);
	auto cfg = doc->doc->first_node();
	assert(!strcmp(to_lowercase(cfg->name()).c_str(),"fontset"));
	auto children = xop.getChildren(cfg);
	for (auto iter : children) {
		if (!strcmp(to_lowercase(iter->name()).c_str(),"font")){
			auto attributes = xop.getAttributes(iter);
			fkey key;
			fpath path;
			for (auto attr : attributes) {
				std::string field = to_lowercase(attr->name()).c_str();
				std::string val = attr->value();
				if (streq(field,"use")) {
					key = std::string(val);
					continue;
				}
				if (streq(field, "path")) {
					path = std::string(val);
					continue;
				}
			}
			setFontPath(key,path);
		}
	}
}
BaseAssets::BaseAssets(){
    string path = ofToDataPath("settings.json");
    ofLogNotice() << "Loading settings from: " << path;
    settings.open(path);
    default_font = "Lato-Bold.ttf";
    ofTrueTypeFont::setGlobalDpi(72);
    clearFonts();
}
Exemple #5
0
SDLFontGL::~SDLFontGL() {
	clearGL();
	clearFonts();
}
ofxTextCircleFill::~ofxTextCircleFill()
{
    clearFonts();
}
Exemple #7
0
FontManager::~FontManager() {
	clearFonts();
}