openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

Can't use OF_TTF_MONO as a font path anymore?

Open moebiussurfing opened this issue 2 years ago • 3 comments

ofTrueTypeFont font
string p = OF_TTF_MONO;
bool b=font.load(p, 20, true, false, true);
ofLog() << (b ? "success" : "failed");
static const std::string OF_TTF_SANS = "sans-serif";
static const std::string OF_TTF_SERIF = "serif";
static const std::string OF_TTF_MONO = "monospace";

I remember using bundled OF_TTF_MONO font as a common path before in OF 0.11... is it still possible to use it like this?

moebiussurfing avatar Dec 09 '23 20:12 moebiussurfing

it should work. which OS are you using?

dimitre avatar Dec 10 '23 00:12 dimitre

I was able to run OK on macOS

ofTrueTypeFont font;

void ofApp::setup(){
	font.load(OF_TTF_MONO, 15);
}

void ofApp::draw(){
	ofBackground(0);
	ofSetColor(255);
	font.drawString("Mono Testando 123\n129384098743021", 40, 40);
}

dimitre avatar Dec 11 '23 13:12 dimitre

So it seems that it's a bug? I am on Windows 11 / Visual Studio 2022 GH master branch

moebiussurfing avatar Dec 11 '23 17:12 moebiussurfing

Traced to two issues. one platform paths for variable path not used.

Second the string for MONO was becoming "Courier New" Screenshot 2024-07-29 at 4 08 41 AM

In the return string this is "courier new"

Screenshot 2024-07-29 at 4 10 13 AM

danoli3 avatar Jul 28 '24 18:07 danoli3