clintbellanger / flare

Free Libre Action Roleplaying Engine
http://clintbellanger.net/rpg/
GNU General Public License v3.0
166 stars 41 forks source link

Support multiple fonts #971

Closed dorkster closed 12 years ago

dorkster commented 12 years ago

font_normal is the default font is required and used when no other font is defined. The font name is the last parameter for font/label functions. So it's like this:

label->set("Fancy text", "font_fancy");

Note that font sizes defined in languages.txt are now scale, and not point size. For example, say a font has a point size of 10. But for a language's font, that's to small. We could then set the scale to something like 1.4 to make the font 14pt.

makrohn commented 12 years ago

So what is the suggested implementation for this? Is this usable just in menus (for example, it would definitely be handy to make this actual text: https://github.com/pennomi/polymorphable/blob/master/mods/core/images/menus/powers_tree.png), or in tooltips and NPC dialog as well? Or is it restricted to translations?

Or am I jumping ahead?

dorkster commented 12 years ago

I think you're jumping ahead a bit. As it stands right now, you would have to add labels to the Powers menu that used a new font style. The purpose of this code is to allow certain parts of the engine to have special fonts (e.g. cutscene text). I'll probably update eatLabelInfo to support font names, so menu label fonts can be changed from config files.

I think for the sake of merging from Flare, you should stick with Polymorphable's current method of doing the Powers menu.

makrohn commented 12 years ago

I'll absolutely stick with the current method, I just wanted clarification.

igorko commented 12 years ago

@makrohn text in your screenshot should be picture (menu background layer) and can't be rendered (and shouldn't) as text. Use your favorite image editor to choose font ;)

makrohn commented 12 years ago

It is part of the .png, yes, but I don't honestly think it should be, for two reasons: 1) I spent the better part of 2003-2005 doing ADA (Americans with Disabilities Act) compliant website design. Images containing text don't produce strings that can be read by a screen reader to blind people. 2) They also don't produce strings that contain translatable text. On a very practical level, there should not be any faux-text anywhere in the game. I'm not sure if this would necessitate a new engine feature to be able to insert static text willy-nilly into menus wherever a modder wants, but I'd be happy to create a separate issue for it (even if it can't benefit from this pull) to be done as part of 0.17 Menus.

igorko commented 12 years ago

Well, I understand, but the initial idea was to add "skill tree" image, as it's done in such games. Instead Polymorphable uses "Level" text, which is not "tree image". We can't add such "garbage" text to menus, which is not supposed to be used. Required level is displayed in power tooltip, so such text will duplicate data. Menu background should not give any info. It should be "just art".

makrohn commented 12 years ago

So really, in Flare-data, Poly, or any other mod, we should try and present that sort of information in tooltips and graphical cues, as opposed to in-panel text. That should be a "good modding habit". I'll buy that (not that Dorkster's menu graphic was wasted effort, it needed to be done for the LPC, but now that the contest is done we shouldn't be using workarounds). In that case, it's a Poly issue to "present powers tree options using graphical cues instead of text," as opposed to a Flare-engine issue to "allow arbitrary text in menus".

igorko commented 12 years ago

@dorkster Redefining font from languages.txt might be improved later. Here what problems I see currently:

Edit: for first case we can add to the lang list font_type, file and size to redefine only needed fonts, the rest can be defaulted to normal.

dorkster commented 12 years ago

Yeah, the way the same language font is used for all definitions is bad. I also don't like that I haven't added a font setting to LabelInfo for menu configuration. And the more I look over the code, the more I'm disliking my overall implementation. So, I'm going to close this for now as it needs more work. Plus, I don't want to introduce any new bugs before the 0.17 release.