Proposed changes to the FONT-system!
#1
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
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#2
this is one of the best news you gave us jonathan, finally we will not have to worry about creating xpr fonts anymore and the possibilty to select the style is just a great!
tnx Smile
XBMC Italian translator, Movieplayer.it scrapers developer and the old "The Orbs" skin creator.
Reply
#3
ok, this may sound stupid, but how about giving skinners the option to render text 90degrees cw or ccw maybe some cases where there's not enough room to do it horiz.

:nuts:
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
so this will be ditching the xpr fonts then? is the only purpose now of the font.xml file now just for <defaultfont>? so the current names like 'font12' will translate into '<defaultfont>12'?

i think a python script should be able to have their own fonts dir (in their cwd) so they can include their own fonts and finally be able to fully control their appearance.

while we are talking about font styles, is there a way to do an outline of a font? this would look great in skins and subtitles.
Reply
#5
xpr fonts can have outlines and shadows.. hope we're not completely getting rid of xpr fonts....

was always a good way to "hide" the true font - i was always using payfonts for my skins. i guess with ttf fonts the copyright will be a biggr issue since everybody coud use ttf fonts h downloaded with a skin on his comp while xpr fonts ar rather useless.

i know other xbox apps are working with ttf allready, but i think xbmc was aways different when it comes to copyrirights

plus xpr fonts are still clearly smoother (specialy in hdtv resos)

yet all im saying is - dont ditch xpr completely...

/chokey
Image

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
hiding them doesn't make things more legal  :d

anyways, i think it would be nice if you could load your own fonts with scripts (naturally scriptwise will be my take on this). i can see several ways of doing this and i can't really decide which would be most convenient..

1. you make your own font.xml and load a font in same dir as this file. this would need to be appended to the already loaded font info, thus you should use your own names. cmd could be like xbmc.loadfont("q:\\scripts\\whatever\\font.xml"). then you just proceed as usual.

2. you could do it that same way as now. much more to code into each line because of the parameter, but perhaps easier for beginners?
eg. xbmcgui.controllabel(1,1,1,1, [fontname (either loaded or filename), size, style, ??])

this presented, i don't know if this is even in question at all...would this be possible and something you would be willing to incorporate? it's kinda enough of a pain getting things to work nice on all tvs/builds/skins already than to stumble upon users with builds where some fonts are missing from main xbmc xml and thus no text is shown or whatever.

the most important thing here is that scripters need larger fonts than font14. at least that's my opinion on it, and a more customisable system would be really good (which we're getting here no matter the outcome as long as ttf is an option in the xml)

last, thanks for bringing this up jonathan. Smile
xbmcscripts.com administrator
Reply
#7
Exclamation 
i like to suggest that we collect and add as many legal ttf-fonts to the xbmc cvs as well (preferably open sourced if possible, but as long as they are free to use for non-commersial projects they will due), that way normal end-users don't have to have to copy fonts from their windows computers to get the ones they need or want, and skinners/python-writters will always have access to a wide base of fonts that they know is always there. ...as a start i think sourceforge.net and freshmeat.net can be scavaged for usage/reusabe fonts (linux-distrubutions could be another source), (check for example out corefonts, xf86-corefonts, linux libertine open fonts, metatype, free unicode fonts , vietunicode, culmus, cjk-environment, free bangla fonts, lala, dustismo) * *...if you find a font in a other format than ttf then mayhe you can try converting it to ttf?, or even create your own (there are many free programs to do this available on sourceforge.net/freshmeat.net).

edit: there's also a huge link-collection of mostly free to use (for non-commersial pursoses) on microsoft's typography (font) site

http://www.dafont.com
http://www.acidfonts.com/dingbats1.htm
http://www.webpagepublicity.com/free-fonts.html

ps! off-topic, i agree with chokemaniac that to have support for outlines and shadows on our ttf fonts too would be a great addition to xbmc as well Cool

@jmarshall, off-topic to above but on-topic for subject of this thread: checkout, open type organizer ttf_lib, choosefont and fontlinge lovely features.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#8
yeah, if enough good fonts are included i can't see that much of a reason to include font loading capabilites from scripts. it works out the way it is now, and with lots of more choices and especially sizes things would work out good i think. if it's not that much work to include it in python i guess it wouldn't hurt, but it seems to me it would require some planning?

i wish more people jumped in here...
xbmcscripts.com administrator
Reply
#9
thanks all for the responses thus-far (hopefully there'll be some more contributing as well!Wink

i am planning on ditching xpr fonts completely, if at all possible. reason is obvious: they can't (easily) handle different fontsets. nothing much can be done about the "smoothness" or otherwise unfortunately - the aliasing is done within the ttf engine. i personally haven't noticed too much of a difference to warrant hanging on to xpr.

as for outlining + shadowing, perhaps we can come up with something for that...

the main idea was to get the font manager to load the fonts as they're needed (currently they're only loaded on skin load - even if they aren't needed until later), and to remove the size/style restrictions on python scripts.

for scripters, the idea is that you just have to change the fontname that you pass to controls (ie no real changes to the interface at all)

eg:

font_18b

will use the normal skin font, size 18, in bold etc.

we could perhaps extend this so that you can also do:

q:\scripts\fonts\blah.ttf_26bi

to load the awesome font blah.ttf in size 26, bold italic, but imo it's better to have scripts use the normal skin stuff as much as possible to keep things consistent (though i know that's difficult in a lot of cases)

orientation vertically is doable, but probably won't be done short-term.

and lastly, i'd personally prefer that we didn't distribute a large number of fonts with the standard xbmc cvs - i don't see the reason for it, as it's generally in the skinners realm to state what type of font "look" they want. then we just include the arial.ttf as a backup for those that require it for foreign language support.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
the thing with having a default font for scripters to use is that it's hard to design for different fonts. a script would look good in pmiii and lousy in serenity ii. if at all possible to do, it would be nice for scripters to have their own fonts.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#11
something i've been "pondering" quite hard lately.
let's face it, ttf looks crap compared to xpr (atleast in pm3), why's this? because the xpr fonts are bitmaps that have been kind of "softened", using a similar method to cleartype ™, this magic is mainly for lcd's but i suspect it may improve quality on crt's a bit also. grc.com has detailed info how it all works (sub-pixel rendering). nevertheless, jmarshall said that its unfortunatly not supported by our current ttf renderer.

if we could get a similar method as cleartype ™ for ttf rendering, they would look similar in quality. then we would have the best of two worlds!



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
to add to this discussion a bit here. i have started a new project on sourceforge called xboxmediacenter toolkit (hope you don't mind the name). i started it as i am planning on developing a few open-source utilities for xbmc in c#. it would make sense to me if the fonts collected were a part of this "toolkit". a small program could then be made to go hand in had with the fonts that could be used to select/preview the font of your choice and set styles you liked, which would generate the font.xml for them (as an example of one of the tools in the set), when you are done. just an idea.

anyways, any xbmc devs/project leaders of course have full rights to be added to the project and i will step down as the admin even and only stay on as a developer of the apps if so desired.
Image
Reply
#13
Sad 
there must be some open source code out there for smoothing (smooth = soften / blur) fonts like cleartype does?, (code that work on our anti-aliased ttf fonts?).

ps! you can find information on cleartype and other specs on related microsoft typography here (link). also checkout allegrofont and freetype libraries for code Wink

edit: did a little research; it appears that microsoft has kind-of open sourced its cleartype® technology (under their ip license for non-commersial use) though i've not found any code Huh



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
Sad 
where did we get our existing ttf-renderer?, might freetype-library be a good alternativ?, (or allegrofont which is a modified version of freetype)
...if our existing ttf renderer is better then maybe someone could look porting some of the extra features that freetype and allegrofont offers?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#15
it's built-in to the xdk.

porting another library for this use is a lot of work, for very little benefit.

i don't have time to change the font system as above anyway before i go on holiday, so it will be remaining as the status-quo as far as i'm concerned.

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Proposed changes to the FONT-system!0