Using fonts in addons/programs

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
pallisvans Offline
Junior Member
Posts: 24
Joined: Jan 2012
Reputation: 5
Location: Reykjavik, Iceland
Post: #1
Is there any way for an addon (other than a skin) to have it's own fonts?
Can it only use Arial (font13) in XBMC/Media/Fonts/ or the fonts in the skin the user has loaded each time?
It's a question of design and a unified interface, only being able to use one font seems kind of silly.

If anyone has any information or input on this it would be greatly appreciated and would save me a lot of time and frustration Confused
find quote
jerimiah797 Offline
Member
Posts: 57
Joined: Mar 2011
Reputation: 2
Post: #2
Currently, no. There is no support for fonts other than those that come with the skin. That being said, the basic solution is to install the fonts into the skin and restart xbmc. This can be done manually by the user, or with some python code. This works for all skins except the built in confluence, but there is even a workaround for that. Just copy the confluence skin folder into the user addons folder along with the other skins, and xbmc will load that copy of confluence first.

The most important thing is that the fonts you install, and the way you refer to them in your addon, must be properly namespaced. That is, the names of your fonts as defined in the font.xml should be unique. Instead of using generic names like 'font13', you should use your addons name as a prefix, such as 'addon_myplugin_font13'. That way the fonts you install in the skin won't have any side affects on the skin itself, but will be available to your (or any) addon that explicitly uses them.

There is a script out there somewhere that does the font installation called MyFont. It copies the .ttfs, and appends the new font definitions to the skin's Font.xml file. As long as your fonts are namespaced like I mentioned, there isn't really any reason to have to uninstall them from the skin.

None of this is officially stated anywhere in the docs, but it is the way to deal with the font problem right now.
find quote
pallisvans Offline
Junior Member
Posts: 24
Joined: Jan 2012
Reputation: 5
Location: Reykjavik, Iceland
Post: #3
Thanks for the answer jerimiah797 Smile
find quote
jerimiah797 Offline
Member
Posts: 57
Joined: Mar 2011
Reputation: 2
Post: #4
No problem. Good luck!
find quote
Raven2005 Offline
Junior Member
Posts: 1
Joined: Oct 2013
Reputation: 0
Post: #5
Font modern antique with original Xbmc 12-13 fonts
find quote