2005-06-24, 18:11
hi again,
as you are all aware, ttf fonts are now running very nicely. they are as fast as using xpr fonts, but use less memory. furthermore, you don't need to generate a different size/style for each thing you want to deal with + they have the added benefit of being easy to obtain and being able to render foreign character sets easily.
the old font system was designed primarily for xpr fonts, and is cumbersome + bothersome to use with ttf fonts. sure, it works fine as it is from a skinners perspective, but doesn't work from a users perspective (hard to change fonts for eastern language users) or from a python scripters perspective (have to "guess" or do workarounds to find what fonts are loaded).
i thus propose the following changes to the font system.
font.xml will now no longer contain differing <fontset> blocks - instead, it should have only 1 block.
secondly, the setup will go as follows:
<fonts>
<defaultfont>arial.ttf</defaultfont>
<font>
<name>special12</name>
<size>16</size>
</font>
<font>
<name>special13</name>
<size>16</size>
<style>bold</style>
</font>
</fonts>
the changes are basically that the fontsets are gone, as are the <filename> tags. you only have the possibility of using the one font, but ofcourse you have the <style> tag to get italics, bold, and bolditalics as you wish. the fonts are referenced by their <name> tags in the other skin files as per usual.
in xbmc, on skin load, it'll load the <defaultfont> font up and use that, unless the user has requested an alternative one (located either in the skin/fonts folder, or in xbmc/media/fonts).
the fonts from within xbmc will be referenced by the following naming system:
fontxxxyy
where xxx is the size, and yy is an optional style parameter (b, i, or bi)
the "normal" fonts we've had up till now (font13 etc.) will thus be auto-translated over by xbmc to the new system, so old python scripts and the like shouldn't need updating.
now, this is all just a proposal - nothing has been set in stone, in fact i've only just started thinking about things.
if any of you can see any issues with it, please raise them now. one thing i'm not sure how to handle is differing resolutions from within python. currently each script has to take care of this for scaling everything else, though, so really this isn't all that much of an issue imo.
note that it will require a compatibility upgrade, thus the skin version will need increasing.
cheers,
jonathan
as you are all aware, ttf fonts are now running very nicely. they are as fast as using xpr fonts, but use less memory. furthermore, you don't need to generate a different size/style for each thing you want to deal with + they have the added benefit of being easy to obtain and being able to render foreign character sets easily.
the old font system was designed primarily for xpr fonts, and is cumbersome + bothersome to use with ttf fonts. sure, it works fine as it is from a skinners perspective, but doesn't work from a users perspective (hard to change fonts for eastern language users) or from a python scripters perspective (have to "guess" or do workarounds to find what fonts are loaded).
i thus propose the following changes to the font system.
font.xml will now no longer contain differing <fontset> blocks - instead, it should have only 1 block.
secondly, the setup will go as follows:
<fonts>
<defaultfont>arial.ttf</defaultfont>
<font>
<name>special12</name>
<size>16</size>
</font>
<font>
<name>special13</name>
<size>16</size>
<style>bold</style>
</font>
</fonts>
the changes are basically that the fontsets are gone, as are the <filename> tags. you only have the possibility of using the one font, but ofcourse you have the <style> tag to get italics, bold, and bolditalics as you wish. the fonts are referenced by their <name> tags in the other skin files as per usual.
in xbmc, on skin load, it'll load the <defaultfont> font up and use that, unless the user has requested an alternative one (located either in the skin/fonts folder, or in xbmc/media/fonts).
the fonts from within xbmc will be referenced by the following naming system:
fontxxxyy
where xxx is the size, and yy is an optional style parameter (b, i, or bi)
the "normal" fonts we've had up till now (font13 etc.) will thus be auto-translated over by xbmc to the new system, so old python scripts and the like shouldn't need updating.
now, this is all just a proposal - nothing has been set in stone, in fact i've only just started thinking about things.
if any of you can see any issues with it, please raise them now. one thing i'm not sure how to handle is differing resolutions from within python. currently each script has to take care of this for scaling everything else, though, so really this isn't all that much of an issue imo.
note that it will require a compatibility upgrade, thus the skin version will need increasing.
cheers,
jonathan