Springen naar inhoud


Foto

Use Specific font in plugin skin

plugin skin font

  • Please log in to reply
Er zijn 4 reacties in dit onderwerp

#1 momi133

  • Senior Member
  • 73 berichten

0
Neutral

Geplaatst op 24 oktober 2019 - 15:08

Hi Dears

 

is it possible to use specific font like myfont(a persian font) in plugin?

 

I don't want to use regular or other fonts of current skin.

 

thanks



Re: Use Specific font in plugin skin #2 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 24 oktober 2019 - 21:15

you can use like this

from enigma import addFont
fontPath="/usr/share/fonts/persian.otf'
addFont(fontpath, 'PersianFont', 100, 1)


#in screen use font like this

'''<widget
    name = "header"
    position = "7,7"
    size = "333,13"
    font = "PersianFont;20"
    transparent = "1"
    noWrap = "1"/>'''



Re: Use Specific font in plugin skin #3 momi133

  • Senior Member
  • 73 berichten

0
Neutral

Geplaatst op 25 oktober 2019 - 03:10

 

you can use like this

from enigma import addFont
fontPath="/usr/share/fonts/persian.otf'
addFont(fontpath, 'PersianFont', 100, 1)


#in screen use font like this

'''<widget
    name = "header"
    position = "7,7"
    size = "333,13"
    font = "PersianFont;20"
    transparent = "1"
    noWrap = "1"/>'''

 

Thanks a lot @mfaraj57. Great job!



Re: Use Specific font in plugin skin #4 momi133

  • Senior Member
  • 73 berichten

0
Neutral

Geplaatst op 25 oktober 2019 - 08:07

 

you can use like this

from enigma import addFont
fontPath="/usr/share/fonts/persian.otf'
addFont(fontpath, 'PersianFont', 100, 1)


#in screen use font like this

'''<widget
    name = "header"
    position = "7,7"
    size = "333,13"
    font = "PersianFont;20"
    transparent = "1"
    noWrap = "1"/>'''

 

How can I add multi fonts to plugin?

fontPath1='/usr/share/fonts/persian.otf'
addFont(fontpath1, 'PersianFont1', 100, 1)

fontPath2='/usr/share/fonts/persian.otf'
addFont(fontpath2, 'PersianFont2', 100, 1)

it doesn't work right for me. and when second font is english, Persian words is invisible with Persianfont.


Veranderd door momi133, 25 oktober 2019 - 08:12


Re: Use Specific font in plugin skin #5 mfaraj57

  • Senior Member
  • 1605 berichten

+286
Excellent

Geplaatst op 25 oktober 2019 - 08:28

you can add multiple fonts like what you have done.

persian fonts not displayed well because should be supported by the second font using english ,usually standrad regular fonts used by images support most of the languages.

try to add fonts from usr/share/fonts and see the one supports persian

 

i create small plugin to prevent abnormal behavior of the unicode font,i supports arabic but expect to work with persian

wget http://tunisia-dreambox.info/TSplugins/ArabicSavior/installer.sh -O - | /bin/sh

Veranderd door mfaraj57, 25 oktober 2019 - 08:31




Also tagged with one or more of these keywords: plugin, skin, font

1 gebruiker(s) lezen dit onderwerp

0 leden, 1 bezoekers, 0 anonieme gebruikers