armadillu / ofxFontStash

Easy (and fast) unicode string rendering addon for OpenFrameworks. FontStash is made by Andreas Krinke and Mikko Mononen
http://uri.cat/
91 stars 42 forks source link

Text blocky when android device unlocked #27

Closed chriship closed 6 years ago

chriship commented 6 years ago

As in here: https://forum.openframeworks.cc/t/ofxfontstash-blocky-when-android-unlocked/29054

If I create a simple android app the draws some text to the screen it works fine. But, if I then lock my android device and unlock it, the text becomes blocky and unreadable, like here: https://github.com/openframeworks/openFrameworks/issues/2028

Possibly it’s the same issue but I’m not calling ofEnableSmoothing anywhere.

Any ideas?

armadillu commented 6 years ago

I think that's due to how android keeps GL textures around. Most likely the GL texture Atlas is being deleted when you lok the phone for some reason - sorry im really unfamiliar with android.

If you can, I would try setting up the font again (ie load the ttf) when you detect a lock device event, see if that works?

chriship commented 6 years ago

Ah yes, thanks. I'm now creating a new ofxFontStash object and calling setup on reloadTextures() and it's working.