SFML community forums

Help => Graphics => Topic started by: thoniel on July 19, 2009, 10:16:27 pm

Title: defaultfont charactersize
Post by: thoniel on July 19, 2009, 10:16:27 pm
hi
is there any chance to change the character size of the default font (using dotnet)?

im writing a very simple gui and i dont want to have to load a font from file if not neccessary, but the default font provided by sfml is way to big.
Title: defaultfont charactersize
Post by: Tank on July 19, 2009, 10:29:41 pm
That's currently not possible. The default character size of 30 is hardcoded. It's difficult to say where that size could be provided. But since it's a *default font*, the easiest way for you would be to indeed load a font by yourself and specify the size you wanted.
Title: defaultfont charactersize
Post by: thoniel on July 19, 2009, 10:43:29 pm
sure but that way i need to deliver a font with the dll and i dont like to have external dependencies where i have no control (room for human errors)

but it seems i have no choice. thanks
Title: defaultfont charactersize
Post by: Laurent on July 19, 2009, 10:59:23 pm
You can change the size of the string independently of the size of the font it uses.

With dotnet you can also embed files in your executable as resources.
Title: defaultfont charactersize
Post by: Tank on July 20, 2009, 12:56:45 am
Quote from: "Laurent"
You can change the size of the string independently of the size of the font it uses.

True, but that's often ugly-looking. I prefer to use an equal-sized font for sf::Strings.

@thoniel:
Human error? Well, if one extracts a ZIP archive for example, what bad things can happen? ;)
Title: defaultfont charactersize
Post by: thoniel on July 20, 2009, 10:05:46 am
well yeah. would have been great if it was avoidable. but i will try in the future to embed the font into the resources.

thanks