hironishihara / ofxTrueTypeFontUC

An extension of ofTrueTypeFont class for using UNICODE characters. Tested on OSX, iOS, and Windows.
Other
115 stars 46 forks source link

Bad font resolution in Windows #23

Closed mateusk closed 7 years ago

mateusk commented 7 years ago

Hi, thanks for this addon, I've been using it for some time. But recently I´m getting a very bad font rendering, text looks like in a very low resolution image. I've tried to change font DPI, change font files, no difference, can´t get it to render properly. I'm using Windows 10, OF 0.9.8. Any hints on what could be the problem?

mateusk commented 7 years ago

I figured out that for some weird reason the bad resolution only happens if I use an instance of ofxTrueTypeFontUC inside a class and create a pointer to that class. For example, I created a class for a button, and used ofxTrueTypeFontUC for the labels. If I create an instance of ofxTrueTypeFontUC in ofApp.cpp, the font rendering is perfect. But when I create a pointer to the class that creates a ofxTrueTypeFontUC instance, then font rendering is terrible. I guess that has something to do with how ofxTrueTypeFontUC uses textures to render the fonts, but it would be nice to better understand the problem.

mateusk commented 7 years ago

Nevermind, the problem was simply the fact that I was passing floats to the x and y position while drawing the text. For some reason, that renders the text terribly.