New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow addons to add fonts. (GNA #21948) #1386
Comments
@gfgtdf Note that it's already possible to do Alternatively, we could package some handwriting fonts with wesnoth itself; I'm not convinced there's a need to allow addons to package fonts. (This can even lead to security issues, if the font files are malicious) @Wedge009 I've relabeled this since the |
The idea was that you can add a font in yoru addon and then use < .. font="my_font_name">, and i'm quite sure that we dont need additinal feature for pango for that.
One could say that handwriting was just an example say someone wanted a pixelfont, or a an oldgerman font. or maybe ven two differnt handwriting fonts in their addon, then a featurerequest at pango for a new know font_family or a new font added to wesnoth itself would not help. |
If we're going to allow UMC to select fonts or font families, we probably want to a Preferences to ignore all that so I can force my game to use a nice, bold, erect font so I can see it. |
UMC can alreaqdy do that, you can write suff like < .. font="font_name"> and if the font is installed on your cpmuter pango will use it (only tested on windows 1.14), what i cannot do it shipping its won fonts within the addon. |
Oh, so the question is to allow the UMC to ADD a new font to the client system? If Wesnoth maintains its own font folder, where Pango looks prior to checking the system fonts, no problem. Otherwise, I'd just close this Issue as too much trouble. It'd be far easier to just have the UMC author write a note suggesting a font and telling us how to find it online. |
Yes, I understood what you suggested. I just think "let addons ship fonts" is not the best way to solve the problem of "let addons create GUI2 dialogs that use custom fonts". As I said, simply shipping a handful of fonts with wesnoth itself would solve the problem. I suggest to do that first. If we ship five fonts with wesnoth and we find that many add-ons use them and add-on authors keep asking us to add more fonts, then we can see about letting add-ons ship their own fonts... but we are not there yet.
Asking to have both fonts added to wesnoth would help, though. And you don't seem to have considered this option. Again, I suggest that you start by shipping some more fonts with wesnoth itself. |
I currently see no advantages of your proposal over letting add-ons ship their own fonts. |
The advantage is that I can replace the fonts with something readable and know it will take care of evereythiung. Otherwise, random UMC will be unplayable because I can't read with it says. |
With respect, @gfgtdf, you sound a little fixated on that particular approach. For one, my proposal means add-ons that use custom fonts will be smaller, and their authors won't have to hunt around for (suitably licensed) font files they can use. Moreover, there have been vulnerabilities where malicious fonts could execute arbitrary code, so loading fonts from add-ons can be a security issue. |
Well yes the iusse is called 'allow addons to add fonts', the usecase from my first post is just an example. Moreover i curently don't really work on the the addon where i needed that anymore so it might not be the best one, but iirc i discussed this proposal before i added it to the tracker (not sure where probably irc or the forums), and got positive feedback about this proposal. And if we focus too much on my example i gave in the first post, we might not cover whatever they needed it for
Hmm i don't think this is really a good reason, you kinda sound like you expect only the worst from umc devs and that they'll use it reclessly, i thinks its somehow safe to assume that addons that are already good will not randomly use new fancy fonts everywhere just because they can.
In my expereince fonts are not that big (filesize) that it'd matter here.
hmm yes searching for fonts is sometimes not that easy, on the other hand we'd need to do this work ourselfes if we went with the ship-fonts-with-wesnoth approach, and might still not find exactly the font that the umc dev wanted.
Hmm certainly an issue to think of, but browsers can 'safely' load custom fonts already iirc, so i is possible. The quesiton is whether the library we use cares for security or not. |
I don't see a problem if the font is not installed but used directly from the UMC folder and if I can disable the feature. My comment earlier was based more on the idea of handwriting fonts. I find many of them quite hard to read. But I'd have no problem with a UMC including a Klingon font, for story purposes because it would be clean we are not intended to read it. |
I think it's probably a good idea to do what jostephd said (bundle some extra decorative fonts such as "handwriting" etc) but also allow addons to bundle new fonts. The reason for this is translations. If something like a handwriting font is bundled with the game, it's our responsibility (more specifically, probably the translators' responsibility) to ensure there is a suitable handwritten font for each supported language. On the other hand, if something like a handwriting font is bundled with an add-on, it's the add-on author's responsibility to ensure that they have support for any language they get a translation for. But there are also cases where the language is irrelevant, like a Klingon font as previously mentioned, or maybe a symbols font or something. So add-on developers should be able to distribute their own fonts as well. Side note: I think Wesnoth should also bundle some of these as fonts for add-on authors to use. I definitely see Gregory Lundberg's point with respect to readability. Allowing custom fonts certainly opens the door to some potentially crazy layouts. But on the other hand, allowing Pango formatting at all has already opened that door, so… |
Link to a forum thread requesting this feature: https://forums.wesnoth.org/viewtopic.php?t=57759&sid=42de4ec6fbe3e7e3ce28daa0dc420809 |
Hi, |
Throught I don't know how hard it is to implement them... |
This sounds like a horrible idea to me… it could maybe work if there was like, one character who speaks in a different font, but if each character or each race had its own font I think I'd get annoyed. |
It probably depends on the fonts. As long as they are all legible, it could be like having different-sounding voices, as different races probably have greater variety than humans do in reality. But you probably don't need fonts for that, you can already adjust pango settings to make the text distinct. |
What I mainly got on mind was a more curly font (and + size) for the Storyteller |
"Curly" might be a stretch, I don't know what all fonts are normally available, but size and distinction is certainly possible without new fonts. Check out https://wiki.wesnoth.org/InterfaceActionsWML#Formatting if you haven't already. |
I would note that if we want to add, say, a "handwriting" font, or if we wanted to support using Oldania in add-ons, it would be best to define generic font families so that add-on authors can just write Of course, referencing an actual font name should obviously be fine too. If someone wants |
Original submission by gfgtdf on 2014-04-21
Ye what i said in the title. I think i'd be nice do allow addon designers to add their own fonts in the game for their scenarios.
When i wrote my last addon i was sad because i wanted to show a letter with a gui2 dialog, but couldn't get a platform independent handwriting font.
(Reproduced on all)
Release: 1.13
Priority: 5 - Normal
Severity: 2 - Minor
The text was updated successfully, but these errors were encountered: