kodi-community-addons / skin.titan

http://forum.kodi.tv/forumdisplay.php?fid=212
GNU General Public License v2.0
29 stars 23 forks source link

font12 definition, window header text & text entry focus #57

Closed mgonzales71 closed 9 years ago

mgonzales71 commented 9 years ago

See: https://github.com/tknorris/salts/issues/86

seems Titan has some issues when it encounters an add-on that includes skin resources that are using confluence as a baseline.

one being a missing font12 definition, and apparently window header and text entry focus (both not displaying).

I can do a pull request after adding the font definition for font12 - actually should look and make sure all the default confluence fonts are defined for the skin just in case,

Do you have any insight into the window header text and text entry focus?

one of the includes maybe? I need to read up on those skin elements - still a novice at skin dev. :)

Thanks goes out to tknorris for the assistance

What it should look like:

screenshot001

What it does look like:

screenshot003

mgonzales71 commented 9 years ago

Marcel,

It looks like confluence defines these baseline font names in all of it's fontsets:

<fontset id="Default" idloc="31390"> 
    <!-- Normal Fonts -->
    <font>
        <name>font10</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>14</size>
    </font>
    <font>
        <name>font12</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>17</size>
    </font>
    <font>
        <name>font13</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>20</size>
    </font>
    <font>
        <name>font14</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>22</size>
    </font>
    <font>
        <name>font16</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>25</size>
    </font>
    <font>
        <name>font30</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>30</size>
    </font>
    <font>
        <name>fontContextMenu</name>
        <filename>Roboto-Regular.ttf</filename>
        <size>18</size>
    </font>

    <!-- Title Fonts -->
    <font>
        <name>font10_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>12</size>
    </font>
    <font>
        <name>font12_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>17</size>
    </font>
    <font>
        <name>font13_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>20</size>
    </font>
    <font>
        <name>font24_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>24</size>
    </font>
    <font>
        <name>font28_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>28</size>
    </font>
    <font>
        <name>font30_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>30</size>
    </font>
    <font>
        <name>font35_title</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>35</size>
    </font>

    <font>
        <name>font_MainMenu</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>40</size>
    </font>
    <font>
        <name>WeatherTemp</name>
        <filename>Roboto-Bold.ttf</filename>
        <size>80</size>
    </font>
</fontset>

Some are defined others are missing - since some of these use fonts and font sizes that differ (even from the Arial fontset defined in the skin confluence) - these changes will be a/of material impact to the skin and I don't want to make arbitrary choices for the font sizes that you want to correspond the the font names, So I will leave it up to you to make those. But I think it would be a good idea to include all the font names above in each the skins fontsets to be better compatible with add-ons that use (and rightly so) confluence and the skin resources they include.

It may be that some default font names will need the font sizes reduced as well as adding the additional font names to better correspond to the scale of the expected defaults.

What do you think?

mgonzales71 commented 9 years ago

The missing Window / Dialog Header Text - never noticed that before. But then it's not often I am in Confluence or another skin - but it's very noticeable in a side by side screenshot.

tknorris commented 9 years ago

I figured out the problem w/ the missing header text.

I'm using the "selected" color for text in the header and that color name is only defined for confluence. I can fix it by picking one of the universal color names.

On a side note though, all the confluence dialogs use "selected" as the color of the dialog header text, so it might make sense including that color in the skin, but I don't mind switching to another color.

mgonzales71 commented 9 years ago

that is easy to do and probably best for compatibility anyway. way to go and thanks again!

Just curious... is this the first time you have used the skin Titan?

Marcel openly welcome thoughts, suggestions, etc if you have any. He is a great guy and has put together what has become my favorite skin,

tknorris commented 9 years ago

Yes, I always run Confluence because whatever I run has to be wife-friendly and I always know that Confluence will run on each Kodi upgrade. It would be mass chaos in my house if I upgraded Kodi and our normal skin didn't work for some period of time.

Also, when doing addon development, I always want things to work there first since that's the default skin.

mgonzales71 commented 9 years ago

Marcel,

The only missing name defined colors from confluence that are not also a system named color are the following:

color name="grey2" FF999999 color name="grey3" FF505050 color name="selected" FFEB9E17 (a gold/orange tone color http://www.colorhexa.com/eb9e17) color name="invalid" FFFF0000 (red)

I suggest that they be added to the skin for compatibility - but maybe change that orange/gold ARGB hex to be the same as mainblue or white?

(had to remove the xml formattting because Git was taking it as markup code LOL)

mgonzales71 commented 9 years ago

Marcel,

Here are the Confluence Fonts (sizes) adjusted from 720 to 1080

http://pastebin.com/qnXxXktg

FYI - This conversion was generated by the Kodi skinning tool

marcelveldt commented 9 years ago

Hi Mario, could you do a PR for the font changes so I can merge it in with git ?

mgonzales71 commented 9 years ago

Ok - I will go ahead and make my best guess for you - but since you are not using Roboto for the default font set in your skin the font sizes (scale / progression of size) may have to be slightly altered. Arial font set will be easy at least.

I will also make changes to the color defaults as well - you have a preference for the selected color?

I am thinking ff6495ed cornflowerblue http://www.color-hex.com/color/6495ed 6495ed

invalid color I will keep red.

mgonzales71 commented 9 years ago

Created PR: https://github.com/marcelveldt/xbmc.skin.titan/pull/61

Here is how the dialog looks now (with these changes):

screenshot000

Much better!

--------- Marcel - Still need to figure out why the buttons are so mangled and why the text entry focus color is not displaying ---------

tknorris commented 9 years ago

The missing colors on the text box might be because add it in code rather than the xml. The strange thing is everythign else picks up the assets from the media folder of the addon but it doesn't seem to for the control I add from code. I might be able to fix it by copying the textures into the addon and then explicitly referring to them with a full path.

mgonzales71 commented 9 years ago

Well I know the skin can have text entry focus color without an actual image/texture but I could not right off see where the code was to do that (my guess its being inherited but could not find where from):

this is screen shot of the skin's SearchDialog.xml:

screenshot001

tknorris commented 9 years ago

The work around of copying the text entry textures into the addon and then referring to them explictly works fine, so I'll just do that in the next build. The only remaining issue is the buttons are a little funky. They're at least readable though.

mgonzales71 commented 9 years ago

tknorris -

I noticed in the Defaults.xml of the skin the textoffsetx was set to 50 (a pretty big number in my opinion but could change from skin to skin)

So decided to peek at your addon's TraktPinAuthDialog.xml file... specifically the button control group and I noticed you did not specify a textoffsetx which led to that large textoffsetx to be inherited from the skin.

So I made a few changes as a test....

note the changes to posx & width and the addition of textoffsetx

<control type="group" id="9001">
        <control type="button" id="200">
            <description>Authorize Button</description>
            <posx>30</posx>
            <posy>460</posy>
            <width>130</width>
            <height>40</height>
            <align>center</align>
            <aligny>center</aligny>
            <label>Authorize</label>
            <font>font12_title</font>
            <textoffsetx>10</textoffsetx>
            <ondown>201</ondown>
            <onright>201</onright>
        </control>
        <control type="button" id="201">
            <description>Later Button</description>
            <posx>170</posx>
            <posy>460</posy>
            <width>170</width>
            <height>40</height>
            <align>center</align>
            <aligny>center</aligny>
            <label>Remind Me Later</label>
            <font>font12_title</font>
            <textoffsetx>10</textoffsetx>
            <onup>200</onup>
            <onleft>200</onleft>
            <ondown>202</ondown>
            <onright>202</onright>
        </control>
        <control type="button" id="202">
            <description>Never Button</description>
            <posx>350</posx>
            <posy>460</posy>
            <width>130</width>
            <height>40</height>
            <align>center</align>
            <aligny>center</aligny>
            <label>No Thanks</label>
            <font>font12_title</font>
            <textoffsetx>10</textoffsetx>
            <onup>201</onup>
            <onleft>201</onleft>
        </control>
    </control>

Result of these changes:

screenshot000

Not saying you need to make these changes but i think the more explicit you are with control tags the better. Also - the middle button had the most characters so I made it slightly wider adjusting the outer two to be less so by the amount donated to the middle button for balance

not that many skins would have a default for it - you could also explicitly state textoffsety as well.

tknorris commented 9 years ago

I'll definitely make those changes. That explains why so little of the text was showing up in this skin. Explicitly specifying the textoffset should fix that for everyone.

tknorris commented 9 years ago

I will push a new beta of SALTS tonight w/ the PIN auth dialog changes. That should get everyone running alternate skins to a point where the dialog can used even in the worst case scenarios.

mgonzales71 commented 9 years ago

excellent! thanks again for hanging in there and the assistance on this issue. much appreciated for the and most importantly your awesome addon :)

mgonzales71 commented 9 years ago

well now the only fear is that some skin will set font12_title to some insane size - LOL

tknorris commented 9 years ago

In the latest xml for the dialog I swapped the two paragraphs for that very reason. That way even if the text goes outside of the bounding box at the very least the first sentence will show up w/ the url in it.

mgonzales71 commented 9 years ago

Grabbed a copy of your addon from Git repo and tested it out in the skin with the changes I made in the PR above...

Looks good!

screenshot001

Marcel - if you are OK with the PR above you can close this issue. (thanks)

TK(norris) - Thanks again for the help!

marcelveldt commented 9 years ago

Thanks! Merged the changes in the skin.