Kodi Community Forum
Adding some fonts for addon developers - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Adding some fonts for addon developers (/showthread.php?tid=214140)

Pages: 1 2 3 4 5 6


RE: [RFC] Adding some fonts for addon developers - ZexisStryfe - 2015-01-11

I have no issue adding these lines to my skin, but the skinner selecting the sizes that "best suit their skin" is almost impossible. Different fonts look different at the same size- ie: The word "KODI" in the font Roboto size 18 may be 70 x 10 pixels, but in the font Arial size 18 may be 60 x 15 pixels. If the add-on builders can select their own font, this will likely still not work well.


RE: [RFC] Adding some fonts for addon developers - topfs2 - 2015-01-11

May I suggest looking at html for inspiration, I know that its very hard to standardize typography so it fits perfectly (have this exact problem at work too).

So basically equivalents to h1, h2, h3, h4, h5, h6, small, large, italic, bold, p?

http://getbootstrap.com/css/#type
http://foundation.zurb.com/docs/components/typography.html


RE: [RFC] Adding some fonts for addon developers - ruuk - 2015-01-11

(2015-01-11, 19:02)ZexisStryfe Wrote: I have no issue adding these lines to my skin, but the skinner selecting the sizes that "best suit their skin" is almost impossible. Different fonts look different at the same size- ie: The word "KODI" in the font Roboto size 18 may be 70 x 10 pixels, but in the font Arial size 18 may be 60 x 15 pixels. If the add-on builders can select their own font, this will likely still not work well.
What is needed is a range of non-caps fonts that are roughly the same size. They don't need to be exactly the same size or font, but width and height as close as possible.

For instance say we made 5 fonts in Confluence called addon_1, addon_2, etc using DejaVuSans. Skinners could then add 5 fonts with the same name making an attempt to match the size of the Confluence addon fonts. If the font doesn't match well then a smaller size could be chosen so if the Confluence is 60x15 and you have a choice of a 60x18 and a 56x14 you could use the latter so at least text will fit in the target control.

While this isn't perfect and not a real solution, it will improve the situation for skinned addons and make them look better when the user has your skin installed than with the current situation.

Hopefully someone can actually add the ability for addons to use their own fonts in their skins so this sort of workaround won't be necessary.


RE: [RFC] Adding some fonts for addon developers - ruuk - 2015-01-11

(2015-01-11, 19:23)topfs2 Wrote: May I suggest looking at html for inspiration, I know that its very hard to standardize typography so it fits perfectly (have this exact problem at work too).

So basically equivalents to h1, h2, h3, h4, h5, h6, small, large, italic, bold, p?

http://getbootstrap.com/css/#type
http://foundation.zurb.com/docs/components/typography.html

While basically this is a good idea, it doesn't work the same, as our controls do not scale for their contents like html, so size differences are even more problematic.


RE: [RFC] Adding some fonts for addon developers - topfs2 - 2015-01-11

(2015-01-11, 19:41)ruuk Wrote: While basically this is a good idea, it doesn't work the same, as our controls do not scale for their contents like html, so size differences are even more problematic.

Well you'll have that problem with the original proposal too. And we could possibly circumvent this by standardizing a few layouts too (via the macro/variable feature).
Another option would be to actually allow html blocking or QML anchoring within our guilib too.


RE: [RFC] Adding some fonts for addon developers - ruuk - 2015-01-11

(2015-01-11, 21:39)topfs2 Wrote:
(2015-01-11, 19:41)ruuk Wrote: While basically this is a good idea, it doesn't work the same, as our controls do not scale for their contents like html, so size differences are even more problematic.

Well you'll have that problem with the original proposal too.

I know, I was just bringing it up because of the html comparison.

(2015-01-11, 21:39)topfs2 Wrote: And we could possibly circumvent this by standardizing a few layouts too (via the macro/variable feature).
Another option would be to actually allow html blocking or QML anchoring within our guilib too.

Things like this would be nice, but require actual coding to be done, which is why we don't have addon skin fonts yet, and why we have the skin workaround proposal in the first place Smile


RE: [RFC] Adding some fonts for addon developers - pecinko - 2015-01-11

And nobody likes my suggestion of Confluence fonts inheritance? I guess it's to simple Smile


RE: [RFC] Adding some fonts for addon developers - Hitcher - 2015-01-12

Perhaps if they could be used without having to add them to every skin.


[RFC] Adding some fonts for addon developers - pecinko - 2015-01-12

(2015-01-12, 02:47)Hitcher Wrote: Perhaps if they could be used without having to add them to every skin.

That was the idea - if fonts or textures are not in script DIR, fallback to active skin and Confluence eventually.


RE: [RFC] Adding some fonts for addon developers - topfs2 - 2015-01-12

(2015-01-12, 11:10)pecinko Wrote:
(2015-01-12, 02:47)Hitcher Wrote: Perhaps if they could be used without having to add them to every skin.

That was the idea - if fonts or textures are not in script DIR, fallback to active skin and Confluence eventually.

Thought we did this already? Or perhaps we do it the other way around? Skin -> Script -> Confluence?
(2015-01-11, 21:51)ruuk Wrote:
(2015-01-11, 21:39)topfs2 Wrote: And we could possibly circumvent this by standardizing a few layouts too (via the macro/variable feature).
Another option would be to actually allow html blocking or QML anchoring within our guilib too.

Things like this would be nice, but require actual coding to be done, which is why we don't have addon skin fonts yet, and why we have the skin workaround proposal in the first place Smile

I think the macro/varible feature thing would be doable already, without any code changes to guilib. But I'll defer that to ronnie and phil65 Smile
And yeah, the anchoring needs code. I wonder if it would be overly much though, I've read through QML anchoring code which was ported to javascript and its not more than a few hundred lines and is very powerful (dare I say its more powerful than html Tongue)


RE: [RFC] Adding some fonts for addon developers - Hitcher - 2015-01-12

Wait a minute, Kodi comes with arial.ttf why can't any addon use that?


RE: [RFC] Adding some fonts for addon developers - topfs2 - 2015-01-12

(2015-01-12, 11:21)Hitcher Wrote: Wait a minute, Kodi comes with arial.ttf why can't any addon use that?

I think the point about the suggestion is that the addon could do simple windows which aligns with the current skin nicely. So if one skin uses greenish 72px roboto as header and another 64px white times new roman they'd could use the same label via font="header" as an example.


[RFC] Adding some fonts for addon developers - pecinko - 2015-01-12

I *think* we don't fallback to Confluence ATM.

Skins use various graphic elements, how do we solve that? We will end up with confluence graphics and sizes used with active skin fonts. Does this really sound as an improvement to you guys?


RE: [RFC] Adding some fonts for addon developers - Jeroen - 2015-01-12

What exactly is holding back a true solution for this anyway? All this is just fighting symptoms instead of getting to the root of the problem, and possibly pushing that even further because the "solution" is "good enough". If this is such a problem for script developers then surely it should get prioritised as such?


RE: [RFC] Adding some fonts for addon developers - Hitcher - 2015-01-12

What we probably need is a few more default controls to stick in the defaults.xml (ie fullscreen texture, dialog texture, header label, etc) and then hopefully everything will look correct in all skins.


This forum uses Lukasz Tkacz MyBB addons.