FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  


FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: [RFC] Font handling rework  (Read 1958 times)


  • Developer
  • Full Member
  • *
  • Posts: 102
    • View Profile
    • IZ dev blog
[RFC] Font handling rework
« on: June 11, 2008, 06:55:00 am »

This has been on my agenda for quite some time,
but I'll start to present my ideas now.

Currently widgets have one and only one font set.
Since in our system a font doesn't include the different sizes
and variants (like bold, italic) it is not possible to have i.e.
a label with mixed bold/normal text.

To keep changes small and manageable I propose the following:

  • Implemenet a class FontSet offering the usuall Font interface
  • These FontSets have a default Font and use set under normal operation, thus they can be used as drop-in replacement of the TTF Fonts.
  • Internally the FontSet manages a map ID->Font which can be set to be the default font by some selectDefault method
  • The real interesting part is now, that the renderString method will now support TAGS for selecting another font. This can start as a very simple technique, and get really good later on.

Of course the datasets should have fontset.xml files and pychan will support both the .font attribute and .fontset.
Text bubbles will be using this new stuff, too, of course.

« Last Edit: June 11, 2008, 03:36:58 pm by mvBarracuda »