I'm quite a noob with libGDX for Android (nice OpenGL wrapper that can also work on PC), and I've read some nice examples of how to show images and shapes.
However, when I wanted to check out how to show text, I noticed that the only thing I could see that this library supports is BitmapFont
, which uses a bitmap for each character. It's ok for some resolutions and font sizes, but it becomes blurry/pixelated for other cases.
Is there any other way to show text using this cool library? Some kind of way to show vector fonts, and also use more popular fonts files extensions other than ".fnt"?
I know that the TextArea class in libgdx is used for user input. People use it so that user can input multiple lines of a String. I need something like a TextArea that does the opposite.
Text Vectorization. Text Vectorization is the process of converting text into numerical representation. Here is some popular methods to accomplish text vectorization: Binary Term Frequency; Bag of Words (BoW) Term Frequency (L1) Normalized Term Frequency (L2) Normalized TF-IDF; Word2Vec
One of the simplest vectorization methods for text is a bag-of-words (BoW) representation. A BoW vector has the length of the entire vocabulary — that is, the set of unique words in the corpus. The vector’s values represent the frequency with which each word appears in a given text passage:
gdx-freetype is not compatible with HTML5. However, you may use the gdx-freetype-gwt library by Intrigus to enable HTML5 functionality. Version 1.9.10.1 remains compatible with never versions of libGDX, including 1.10.0.
There is a recent entry on the badlogic blog about generating bitmap fonts on the fly from TrueType font files that should address your problems with packaged font files that are ugly when scaled.
When I was new to Android and libGDX I spent some time looking for a vector font solution to draw scalable text via libGDX. I never found anything (not even generic Java or generic Android). Most font solutions I found are built on bitmaps or were very complex rendering systems (that would be hard to adapt to OpenGL). This seems a bit odd to me too, and I haven't found a coherent explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With