Main index > Usage problems > font setting error [SOLVED]

By deanpence (User), on Wed Mar 9 14:17:44 2005, last edited on Wed Mar 9 16:40:01 2005: font setting error [SOLVED].

I'm using the newest yab desklet, and I'm encountering a problem configuring the font. I'm not sure if the problem is specific to the desklet or the adesklet program, so I figured I'd post it here.

When I change the font setting ("caption_font" and "caption_size") directives/variables, I always get an error. When I use "Verdana" and any size, I get this error:

Code:

dean@dh1:yab> ADESKLETS_ID=0 python yab.py 
Traceback (most recent call last):
  File "yab.py", line 598, in ?
    Events(dirname(__file__)).pause()
  File "yab.py", line 190, in __init__
    adesklets.Events_handler.__init__(self)
  File "/usr/lib/python2.3/site-packages/adesklets/events_handler.py", line 157, in __init__
    self.ready()
  File "yab.py", line 233, in ready
    adesklets.context_set_font(
  File "/usr/lib/python2.3/site-packages/adesklets/commands.py", line 696, in load_font
    return comm.out()
  File "/usr/lib/python2.3/site-packages/adesklets/commands_handler.py", line 103, in out
    raise ADESKLETSError(4,message)
adesklets.error_handler.ADESKLETSError: adesklets command error - font 'Verdana/12' could not be loaded


When I use any font name with spaces, I get:

Code:

dean@dh1:yab> ADESKLETS_ID=0 python yab.py 
Traceback (most recent call last):
  File "yab.py", line 598, in ?
    Events(dirname(__file__)).pause()
  File "yab.py", line 190, in __init__
    adesklets.Events_handler.__init__(self)
  File "/usr/lib/python2.3/site-packages/adesklets/events_handler.py", line 157, in __init__
    self.ready()
  File "yab.py", line 233, in ready
    adesklets.context_set_font(
  File "/usr/lib/python2.3/site-packages/adesklets/commands.py", line 696, in load_font
    return comm.out()
  File "/usr/lib/python2.3/site-packages/adesklets/commands_handler.py", line 103, in out
    raise ADESKLETSError(4,message)
adesklets.error_handler.ADESKLETSError: adesklets command error - font description incorrect - should be `name/size'


I'd like to be able to use other fonts than the provided "Vera" font, but I can't get it to work. I assumed since adesklets uses fontconfig that I would have no problems using font names as they are listed in `fc-list`.

By syfou (Core Developer & Desklet Author), on Wed Mar 9 14:31:34 2005.

deanpence wrote:


I'm not sure if the problem is specific to the desklet or the adesklet program, so I figured I'd post it here.

This was the right place, since it is not yab-specific.

deanpence wrote:


I'd like to be able to use other fonts than the provided "Vera" font, but I can't get it to work. I assumed since adesklets uses fontconfig that I would have no problems using font names as they are listed in `fc-list`.

You are right, you should not have problems... I just temporarily abducted a copy of verdana from an old windows partition, and here is what I get:

Code:


sylvain ~ # adesklets :
adesklets 0.4.4 (Tue Mar 8 03:13:00 EST 2005), on Linux 2.6.11
[i686-pc-linux-gnu-gcc 686-pc-linux-gnu-gcc (GCC) 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7)]
Press TAB for hints.
0 >>> load_font 
Vera      VeraMoBI  VeraSe    luximb    luxirb    luxisb    morpheus  
VeraBI    VeraMoBd  VeraSeBd  luximbi   luxirbi   luxisbi   notepad   
VeraBd    VeraMoIt  cinema    luximr    luxirr    luxisr    verdana   
VeraIt    VeraMono  grunge    luximri   luxirri   luxisri   
0 >>> load_font verdana 
command 0 error: font description incorrect - should be `name/size'
1 >>> load_font verdana/12
command 1 ok: new font 0



Just wondering: have you tried what's in the FAQ ? What were the results?

By deanpence (User), on Wed Mar 9 16:39:39 2005.

syfou wrote:

Just wondering: have you tried what's in the FAQ ? What were the results?


Thanks very much for the assistance. I used the exact name of the font file (without the .ttf extension), and it worked like a charm.

Code:

dean@dh1:yab> adesklets :           
adesklets 0.4.4 (Wed Mar 9 13:06:31 EST 2005), on Linux 2.6.10-gentoo-r6-3
[i686-pc-linux-gnu-gcc 686-pc-linux-gnu-gcc (GCC) 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)]
Press TAB for hints.
1 >>> load_font 
Gentium      QUENYAA      VeraMoIt     cour         luximri      timesi
GentiumAItI  SINDAR       VeraMono     courbd       luxirb       trebuc
GentiumAlt   SINDARA      VeraSe       courbi       luxirbi      trebucbd
GentiumI     SINDCAP1     VeraSeBd     couri        luxirr       trebucbi
NOLDCAP1     SINDCAP2     andalemo     georgia      luxirri      trebucit
NOLDCAP2     Tengwarc     arial        georgiab     luxisb       verdana
NOLDOR       Vera         arialbd      georgiai     luxisbi      verdanab
NOLDORA      VeraBI       arialbi      georgiaz     luxisr       verdanai
Parmaite     VeraBd       ariali       impact       luxisri      verdanaz
QUENCAP1     VeraIt       ariblk       luximb       times        webdings
QUENCAP2     VeraMoBI     comic        luximbi      timesbd      
QUENYA       VeraMoBd     comicbd      luximr       timesbi      
1 >>> load_font verdanab/20
command 1 ok: new font 0


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.