Help with fonts and includes
#1
Hi, I have a problem where I have an addon dependency for some extra fonts, but it can't currently be approved in the official repo due to an issue with the Addon Checker used as part of the approval process (it currently doesn't see kodi.resource.font as a valid extension point: https://github.com/xbmc/repo-resources/pull/392)

As there's an indefinite time frame on a fix, I need to remove the dependency as it's currently holding my skin back from being able to be installed in the official repo.

But instead of throwing the baby out with the bathwater and removing the additional fontset from Font.xml entirely, I wanted to see if there was a way to have it available via a conditional include for people who have installed the extra fonts from my repository already or are willing to do so for CJK support.

In the wiki, it suggests this should be possible: https://kodi.wiki/view/Fonts
It is possible to use includes (eg. <include>MonoSpace</include>) in Font.xml There has to be at least one font set with the unicode attribute set to true else languages like Chinese or Korean will not display properly.

I just can't seem to get this working though. I've tried putting the whole fontset in an include with a condition like so:

xml:


<include name="Additional_Fontset">
    <fontset id="Inter + Noto Sans KR" unicode="true">
         <font>
         ...
         </font>
    </fontset>
</include>

Then in my Font.xml, adding the include even without a condition, e.g. <include>Additional_Fontset</include>, doesn't work. Going to Settings > Interface > Fonts, I only see my Default. Not the additional fontset.

@ronie @jurialmunkey sorry to ask directly - do you know if it's possible to use includes with Fonts.xml somehow and I'm getting it wrong? Alternatively is there another way I can have the additional fontset from an addon supported by my skin without needing the dependency?
Reply
#2
I'm pretty sure that won't work.  I remember trying to get an include to work with fontsets in my Estuary mod, and it wouldn't include the fontset when doing it the way you did.  I had to do this:
xml:
    <fontset id="RobotoCondensed" idloc="31522">
        <include>ModFontsRobotoCondensed</include>
    </fontset>    
Which was fine for my use case (trying to keep all the mod stuff in one include file), but won't help you at all with your use case.
Reply
#3
(2023-05-13, 12:04)pkscout Wrote: I'm pretty sure that won't work.  I remember trying to get an include to work with fontsets in my Estuary mod, and it wouldn't include the fontset when doing it the way you did.  I had to do this:
xml:
    <fontset id="RobotoCondensed" idloc="31522">
        <include>ModFontsRobotoCondensed</include>
    </fontset>    
Which was fine for my use case (trying to keep all the mod stuff in one include file), but won't help you at all with your use case.

Thanks, yeah I tried that and it left the second fontset empty although still selectable. But... actually the fontset is the same but with additional CJK characters that I manually added in.

The reason being that there will still be a lot of western characters in the skin because it doesn't have many translations yet and I wanted to western characters to match the design. Meaning the choice is effectively Inter or Inter + Noto Sans combined.

So maybe I can use one fontset with font-level includes and if you have the additional font pack installed you just get the second choice. I think there would be no discernable difference for non CJK, so it might work... thanks for the inspiration!
Reply

Logout Mark Read Team Forum Stats Members Help
Help with fonts and includes0