SFML community forums
General => General discussions => Topic started by: Laurent on October 14, 2009, 11:34:17 am
-
Hi
I've added code in the SFML 2 branch to use stb_truetype instead of FreeType. The code is not activated by default, you have to uncomment the "#define SFML_USE_STBTT" at the beginning of src/SFML/Graphics/FontLoader.cpp to enable it.
I'd like to know what you think of it, i.e. is the quality worse / the same / better than with FreeType. Personnally I feel like the quality is slightly worse, but I did only a few tests :)
Thanks
-
Fontsizes aren't taken into account on my system. Besides of that, the strings look good. ;)
Unfortunately I had some minor issues with compiling:
In file included from FontLoader.cpp:438:
../../SFML/Graphics/stb_truetype/stb_truetype.h:547: error: comma at end of enumerator list
../../SFML/Graphics/stb_truetype/stb_truetype.h:554: error: comma at end of enumerator list
../../SFML/Graphics/stb_truetype/stb_truetype.h:561: error: comma at end of enumerator list
../../SFML/Graphics/stb_truetype/stb_truetype.h:571: error: comma at end of enumerator list
../../SFML/Graphics/stb_truetype/stb_truetype.h:581: error: comma at end of enumerator list
I guess Microsoft compilers don't complain about that, eh? ;)
-
Fontsizes aren't taken into account on my system
Really?
I noticed a difference in the height of rendered characters between FreeType and stb_truetype, but it was not ignored.
Unfortunately I had some minor issues with compiling
There are several warnings in this library, I guess the author can fix them quickly if I ask him to ;)
However I got no error. I even thought that the standard explicitely allowed a comma after the last value of an enum. After a quick Google search, I found that C99 allows it and that the next C++ standard will allow it as well.
I guess Microsoft compilers don't complain about that, eh?
Yet, I have checked the "disable language extensions" option :evil:
-
Really?
I noticed a difference in the height of rendered characters between FreeType and stb_truetype, but it was not ignored.
No, not really. ;) I did some more checks and stb_truetype fails to load a specific TTF file. I uploaded it here (http://pitload.org/get/1785).
Btw, is there a special reason why you're switching font backends?
-
Btw, is there a special reason why you're switching font backends?
I like removing such big dependencies.
stb_truetype is one single file in public domain, that can be included directly into SFML. I love that :)
But of course I won't switch until I'm sure that I can get exactly the same features, same quality and no bug.
-
stb_truetype is one single file in public domain, that can be included directly into SFML. I love that :)
I agree with that. :)
But of course I won't switch until I'm sure that I can get exactly the same features, same quality and no bug.
The quality looks good, but maybe it's not compatible with all types of truetype fonts (warning, dangerous superficial knowledge ;)).