Adding fonts as part of a theme (similar to adding colors)
#1
How would you all feel about adding fonts as part of a skin theme, similar to the way colors are added?
You could put a file called ThemeName.xml in the skin /fonts directory.
Ex:
<?xml version="1.0" encoding="UTF-8"?>
<fonts>
    <fontset id="ThemeName">
        <font>
            <name>SKIN_FontName</name>
            <filename>newfontfile.ttf</filename>
            <size>20</size>
        </font>

        …
    </fontset>
</fonts>
All the new font .ttf files would go in the /fonts directory as is the case today.
Then any xml files in the skin /fonts directory would be read to get fontset names. The fontset names would be listed in the gui as available fonts, and if a theme is chosen, the fontset with the same name would also be chosen automatically.
This way, if you wanted to provide new fonts in a theme for a skin, you could make a zip file that would have graphics, colors, and fonts, and you would not have to edit the skin’s font.xml to get the new fontset added.

I took a pass at this.
I modified xbmc/addons/Skin.cpp:CSkinInfo::SettingOptionsSkinFontsFiller to get the new fontset names from xml files in the /fonts directory.
I modified xbmc/guilib/GUIFontManager.cpp:GUIFontManager::LoadFonts to search for fontsets in the new xml files, and load the specified fonts.
A lot of it works, The gui finds the new fontsets, it tries to load the fonts specified in the new fontset when you switch themes, but for some reason, in GUIFontManager::LoadTTF, when it checks to see if the ttf files exist , it always returns false, even though each ttf file does exist in the skin /fonts directory .
Before I go any further, is this something that you would accept as a new feature in Kodi? If so, is there anyone who would be willing to help me with the ttf files not being found problem?
Thanks
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Adding fonts as part of a theme (similar to adding colors)00
This forum uses Lukasz Tkacz MyBB addons.