Kodi Community Forum

Full Version: Multiple fonts for a single label?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to have a single label include multiple fonts?

I would like to use some FontAwesome glyphs in a label, but would like to match them with some text. Is there a formatting label/code I can use to do this? Or do I need to build a custom font that contains both its complement if glyphs as well as the FontAwesome glyphs? (Similarly, I would like to do the same with the Weather Icons font, too.)

I know that on Linux Kodi compiles against fontconfig, so if my inheritance is done properly there, will Kodi honor it? I don't believe so, because I get empty glyph boxes or nothing in some skins' fonts even if I have fonts with the requisite glyphs installed, but can someone clarify this?

The ultimate goal is a skin that is primarily text with contrast and colors defined by the elements/controls of the skin, using images/textures for media artwork.
You can use a grouplist and auto-width labels.

https://github.com/HitcherUK/skin.ftv/bl...av.xml#L40
Perhaps I haven't fully grasped how Kodi's controls interact with one another, but looking through your code briefly I didn't see any labels with multiple font definitions, nor did I see how an "auto-width" setting would facilitate this.

Could you supply a snippet of XML that shows a label that would incorporate two separate strings that are set in two separate fonts?
Yes looking at his code that would be the way to do it. You need to use a separate control label for each font. So you can see he has 4 different fonts.

So say if I wanted to have "hello" with each letter a different font, I would have to create a grouplist and then have a label control for each letter with a different font.

Label 1 = h, font = max
Label 2 = e, font = mid
Label 3 = l, font = low
Label 4 = l, font = bold
Label 5 = o, font = italic

Sorry writing on a phone. Hope that helps. His code is the best example I just hope I helped explained it.
(2016-06-20, 14:42)Rjsachse Wrote: [ -> ]Yes looking at his code that would be the way to do it. You need to use a separate control label for each font. So you can see he has 4 different fonts.

So say if I wanted to have "hello" with each letter a different font, I would have to create a grouplist and then have a label control for each letter with a different font.

Label 1 = h, font = max
Label 2 = e, font = mid
Label 3 = l, font = low
Label 4 = l, font = bold
Label 5 = o, font = italic

Sorry writing on a phone. Hope that helps. His code is the best example I just hope I helped explained it.

Ah, yes I see now. Thank you. The grouplist functionality is exactly what I was looking for.