Skip to content

Instantly share code, notes, and snippets.

@hiroMTB
Created July 3, 2018 18:05
Show Gist options
  • Save hiroMTB/2b57464843cb1937081ab7e7c944fae2 to your computer and use it in GitHub Desktop.
Save hiroMTB/2b57464843cb1937081ab7e7c944fae2 to your computer and use it in GitHub Desktop.
#include "ofApp.h"
void ofApp::setup(){
ofBackground(0, 255);
ofTrueTypeFont::setGlobalDpi(72);
font.load("Gotham Bold.otf", 22, true, true);
font.setLetterSpacing(3);
}
void ofApp::draw(){
ofPushMatrix();
ofTranslate(20, ofGetHeight()/2);
ofSetColor(255);
font.drawString("OMNIJEWEL SATELLITE SPEAKERS", 0, 0);
ofPopMatrix();
ofDrawBitmapStringHighlight("Letter Spacing : "+ ofToString(lp,2), 20, 20);
}
void ofApp::keyPressed(int key){
switch(key){
case OF_KEY_UP:
lp += 0.1;
font.setLetterSpacing(lp);
break;
case OF_KEY_DOWN:
lp -= 0.1;
font.setLetterSpacing(lp);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment