Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofTrueTypeFont looks clunky (like slow framerate) while translating

$
0
0

@morphogencc wrote:

I've been using some ofTrueTypeFonts in my recent project, and have been playing with translating text. When moving slowly across the screen, I've found that the text looks like it move "chunkier" than shapes do when translating. A quick example:

void ofApp::setup(){
    mProgramBook118.load("fonts/ProgramOT-Book.otf", 118, true, true);
    mTextPosition = new ofPoint(0, ofGetWidth()/3.0);
}

//--------------------------------------------------------------
void ofApp::update(){
    mTextPosition->x += 0.2;
}

//--------------------------------------------------------------
void ofApp::draw(){
    ofBackground(64);
    ofSetColor(255);
    mProgramBook118.drawString("hello world", mTextPosition->x, mTextPosition->y);
    ofDrawRectangle(mTextPosition->x, mTextPosition->y, 400, 100);
}

I find when I run this, the rectangle looks to smoothly translate from the left edge to the right edge, but the text noticeably looks like it's "snapping" to the next pixel every 10 frames or so, almost as if I had a really low framerate (but the frame rate holds steady at 60 fps).

Does anyone have suggestions on what I might be able to do to alleviate this?

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles