How to use a custom font in my add-on?
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
How to use a custom font in my add-on?
Hi,
I've got a .ttf and .otf font files, but I don't know how to use them in my messages(and story).
I haven't found any examples...
Any ideas?
I've got a .ttf and .otf font files, but I don't know how to use them in my messages(and story).
I haven't found any examples...
Any ideas?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How to use a custom font in my add-on?
It is not currently possible.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
Oh hell, why???
Is it becouse of the security or lack of people to do so?
Is it becouse of the security or lack of people to do so?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
Can I workaround it? (make .png from the characters and then put pngs there instead of characters or smt)?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How to use a custom font in my add-on?
Mostly it just hasn't been implemented yet - the github issue for it is https://github.com/wesnoth/wesnoth/issues/1386
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
10 Years?!!!
Idk the Wesnoth code and I'm not really used for c++ but when there are basic fonts, why can't I use custom?
Idk the Wesnoth code and I'm not really used for c++ but when there are basic fonts, why can't I use custom?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How to use a custom font in my add-on?
Because either the fonts need to be installed on your system or Wesnoth needs to load them, and letting Wesnoth load custom fonts hasn't been a priority.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
Oh, poor.
So whats the best way to workaround that?
So whats the best way to workaround that?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How to use a custom font in my add-on?
As far as I know, there isn't one.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
Aaand do you thing someone is going to add [fonts] into working add-on tags? (It looks like not, since its 10 years...)
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Pentarctagon
- Project Manager
- Posts: 5599
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: How to use a custom font in my add-on?
I don't know of anyone planning to work on it currently. Commenting there as someone who would use the feature would increase the likelihood though.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: How to use a custom font in my add-on?
This is really a problem. While it would be easy to implant several free fonts (and really have to be free to be used for commercial purpose) and make the player select a font, it is another caliber of allowing player to upload a custom font. You can never control if there is a copyright issue and if the player just found a font somewhere. And this is just one aspect.
Another aspect is that it has to support all kind of different signs and is truly an open type font. Utopia, even so you buy a new font now, for example doesn't contain any signs that are used in eastern Europe, maybe because it was designed in the Eighties. Many other open fonts don't support signs, left alone that some signs that exist can't be interpreted by an output unit.
Of course I have no idea about that matter, I've just been admin for several publishers and was in charge for the fonts, so I'm just a random voice from the internet.
Another aspect is that it has to support all kind of different signs and is truly an open type font. Utopia, even so you buy a new font now, for example doesn't contain any signs that are used in eastern Europe, maybe because it was designed in the Eighties. Many other open fonts don't support signs, left alone that some signs that exist can't be interpreted by an output unit.
Of course I have no idea about that matter, I've just been admin for several publishers and was in charge for the fonts, so I'm just a random voice from the internet.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: How to use a custom font in my add-on?
Just to put it on the right note... I have full compatibility, all weird characters, and license.
You think license is such a problem? Can't just remove it from add-on server if it violates rules and tell the creator to rework the font thing... same like with images?
You think license is such a problem? Can't just remove it from add-on server if it violates rules and tell the creator to rework the font thing... same like with images?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- lhybrideur
- Posts: 379
- Joined: July 9th, 2019, 1:46 pm
Re: How to use a custom font in my add-on?
I was going to say the same thing as ZombieKnight.
It is not a bigger problem than the rest of the stuff that are in add-on.
BfW neither checks for licensing of art nor if the add-on works, so it would be the problem of the one publishing the add-on adding the new font to check for the license and the completeness of the font..
It is not a bigger problem than the rest of the stuff that are in add-on.
BfW neither checks for licensing of art nor if the add-on works, so it would be the problem of the one publishing the add-on adding the new font to check for the license and the completeness of the font..
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: How to use a custom font in my add-on?
I don't think there is anything technically difficult about supporting custom fonts – we already let translators add arbitrary fonts suitable to their language, if necessary. It's mostly just that no-one ever found the time and motivation to do it. A pull request would very likely be accepted, if there were someone technically-inclined willing to implement it.