Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load() method #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ofxFontStash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool ofxFontStash::setup( string fontFile, float lineHeightPercent , int texDime
stash->charSpacing = 0.0; //spacing neutral by default
stashFontID = sth_add_font( stash, ofToDataPath( fontFile ).c_str() );
if ( stashFontID != 0){
ofLogNotice("ofxFontStash", "loaded font '%s' in texture (%d x %d)", fontFile.c_str(), texDimension, texDimension );
ofLogVerbose("ofxFontStash", "loaded font '%s' in texture (%d x %d)", fontFile.c_str(), texDimension, texDimension );
return true;
}else{
ofLogError("ofxFontStash", "Can't load font! '%s'", fontFile.c_str() );
Expand Down Expand Up @@ -403,6 +403,10 @@ void ofxFontStash::setLineHeight(float percent){
//--------------------------------------------------------------
// ofTrueTypeFont parity methods
bool ofxFontStash::loadFont(string filename, int fsize, float lineHeightPercent, int textureDimension){
return load(filename, fsize, lineHeightPercent, textureDimension);
}

bool ofxFontStash::load(string filename, int fsize, float lineHeightPercent, int textureDimension){
fontSize = fsize;
return setup(filename, lineHeightPercent, textureDimension);
}
Expand Down
3 changes: 2 additions & 1 deletion src/ofxFontStash.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class ofxFontStash{
void setLodBias(float bias); //only makes sense when using mipmaps!

// ofTrueTypeFont parity methods
bool loadFont(string filename, int fontsize, float lineHeightPercent = 1.0f, int textureDimension = 512);
bool load(string filename, int fontsize, float lineHeightPercent = 1.0f, int textureDimension = 512);
OF_DEPRECATED_MSG("Use load instead", bool loadFont(string filename, int fontsize, float lineHeightPercent = 1.0f, int textureDimension = 512));
bool isLoaded();

void setSize(int fontsize);
Expand Down