Jump to content


Photo

Font sizes in plugin


  • Please log in to reply
12 replies to this topic

#1 satenkabelgluurder

  • Senior Member
  • 141 posts

+2
Neutral

Posted 21 August 2017 - 12:08

Hi,

 

At the moment im "trying" to write a plugin myself.

 

Now I have a few question:

 

It seems that the same font settings in different plugins behave different.

So for example font="Regular;18 wil have a different size on the screen depending on the plugin.

 

So is the font size somehow related to the resolution of the skin that is used ?

 

And if yes how can i "tell" my plugin to use the HD resolution ?

 

 

 



Re: Font sizes in plugin #2 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 13:52

regular font determined by the applied skin of the image will have same size in all plugins,and sizes different between hd and full hd skin

to know if have hd skin or full hd skin is simple

from enigma import  getDesktop

reswidth = getDesktop(0).size().width()
resheight = getDesktop(0).size().height()

if reswidth==1080:
   skin_res='HD'
elif reswidth==1290:
   skin_res="FHD"
else:
   skin_res="skin-"+str(reswidth)


Re: Font sizes in plugin #3 littlesat

  • PLi® Core member
  • 56,258 posts

+691
Excellent

Posted 21 August 2017 - 14:46

This is not done....
but oe-a images like openatv did start it that way...
smarter is to recalculate it in a centralized way... or add the plugin screen to the common skin

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Font sizes in plugin #4 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 15:15

sorry the numbers in the code block above are wrong the true

from enigma import  getDesktop

reswidth = getDesktop(0).size().width()
resheight = getDesktop(0).size().height()

if reswidth==720:
   skin_res='HD'
elif reswidth==1080:
   skin_res="FHD"
else:
   skin_res="skin-"+str(reswidth)

Edited by mfaraj57, 21 August 2017 - 15:15.


Re: Font sizes in plugin #5 ims

  • PLi® Core member
  • 13,623 posts

+212
Excellent

Posted 21 August 2017 - 15:23

try once again ...


Kdo nic nedělá, nic nezkazí!

Re: Font sizes in plugin #6 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 15:34

from enigma import  getDesktop

reswidth = getDesktop(0).size().width()
resheight = getDesktop(0).size().height()

if reswidth==1080:
   skin_res='HD'
elif reswidth==1920:
   skin_res="FHD"
else:
   skin_res="skin-"+str(reswidth)

hope this is final correction,not my day



Re: Font sizes in plugin #7 ims

  • PLi® Core member
  • 13,623 posts

+212
Excellent

Posted 21 August 2017 - 15:39

I am using this...

desktop = getDesktop(0)
width = desktop.size().width()
fullHD = False
if width > 1280:
	fullHD = True

(btw ... FullHD is 1920x1080)


Edited by ims, 21 August 2017 - 15:40.

Kdo nic nedělá, nic nezkazí!

Re: Font sizes in plugin #8 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 15:48

sure,same idea,wrong again in my code,should be ,never trust my memory but today i tried with severe failure 

from enigma import  getDesktop

reswidth = getDesktop(0).size().width()
resheight = getDesktop(0).size().height()

if reswidth==1280:
   skin_res='HD'
elif reswidth==1920:
   skin_res="FHD"
else:
   skin_res="skin-"+str(reswidth)


Re: Font sizes in plugin #9 littlesat

  • PLi® Core member
  • 56,258 posts

+691
Excellent

Posted 21 August 2017 - 15:59

Why reading resheight = getDesktop(0).size().height() when you only use reswidth = getDesktop(0).size().width()


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Font sizes in plugin #10 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 16:20

Not applicable in the code block above but sometimes needed it  to adjust height of widget  position relative to desktop height

just for who ask to know these two functions


Edited by mfaraj57, 21 August 2017 - 16:21.


Re: Font sizes in plugin #11 littlesat

  • PLi® Core member
  • 56,258 posts

+691
Excellent

Posted 21 August 2017 - 16:38

Not applicable in the code block above but sometimes needed it  to adjust height of widget  position relative to desktop height

->

For this you can use c, e center etc...

 

But I hate having these kind of instructions in the code. It shouldn't be there... better add the screen you want to the standard skin and/or try to use existing screens if possible.


Edited by littlesat, 21 August 2017 - 16:39.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Font sizes in plugin #12 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 21 August 2017 - 17:23

we are talking about plugin,mean to use with different images with different skins with different resolution

i do not know e,c can be interpreted by other images than openpli

i found the most flexible way to collect all plugin screens in skin.xml and put it in the root of the plugin directory and to load this skin.xml from the start screen or plugin.py and to call screen names from  different screen classes


Edited by mfaraj57, 21 August 2017 - 17:24.


Re: Font sizes in plugin #13 littlesat

  • PLi® Core member
  • 56,258 posts

+691
Excellent

Posted 21 August 2017 - 18:10

As far I know openatv has them aswell...

Edited by littlesat, 21 August 2017 - 18:11.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users