SFML community forums
Help => Graphics => Topic started by: dunce on September 10, 2007, 01:32:57 pm
-
SFML font tutorial says:
SFML is able to load any valid font file (TTF, CFF, PCF, BDF, and a lot more)
I don't manage to pre-load windows fonts *.fon. The files was produced out of *.ttf files with a conversion tool. In Windows I can use these files without problems, but SFML application renders the example string with the default font and ignores my efforts to use *.fon. If I use the original *.ttf font (mistral.ttf in this case), everything works fine.
Am I doing anything wrong? Is the *.fon font format supported?
.....
sf::String::PreloadFont("mistral.fon", 36.0f, L"ABCDE");
sf::String alphabet1;
alphabet1.SetFont("mistral.fon");
alphabet1.SetSize(36.0f);
alphabet1.SetLeft(10);
alphabet1.SetTop(160);
alphabet1.SetText("ABCDE");
.....
App.Draw(alphabet1);
-
SFML internally uses the FreeType library, so it can load what FreeType can load.
From the FreeType features page :
* TrueType fonts (and collections)
* Type 1 fonts
* CID-keyed Type 1 fonts
* CFF fonts
* OpenType fonts (both TrueType and CFF variants)
* SFNT-based bitmap fonts
* X11 PCF fonts
* Windows FNT fonts
* BDF fonts (including anti-aliased ones)
* PFR fonts
* Type 42 fonts (limited support)
-
I've tried to use BDF fonts. No success. :( The text is rendered with the default font. I want to use my own bitmap fonts to avoid licensing issues. Free TrueType and OpenType fonts that I found have restrictions on commercial use. Has anyone used BDF fonts out-of-the-box with SFML or directly with FreeType2? It seems that I need some guidance.