On Wed, Dec 29, 1999 at 01:10:25AM +0100, josvanr <[EMAIL PROTECTED]> wrote:
> I'm still working on my gimp-perl script for translating
> Blackbox themes to fvwm2 themes, and it's almost done. One
> more thing I need to do, is to find the pixel size of a given
> font name. There are several forms that can be used eg:

I am not exactly sure what you want to do. If all you want to do is call
gimp_something_fontname, then have a look at how other scripts do it:

# grep _fontname examples/*
terral_text:    $floating=$textlayer->text_fontname($width_offset, $height_offset, 
$text, 0,0,xlfd_size($font), $font); 

The key is "xlfd_size" (which is exported by the Gimp module), which
extracts the fontsize from the xlfd and returns size and type (i.e. it
supplies two arguments).

> lucidasans-10 

This won't be accepted anyway, I am afraid you must use the canonical name.

Another way that all script-fu scripts use is requesting the font size
via a seperate input slider/widget/whatever, and ignoring what the user
selects.  This, however, tends to irritate users.

> gimp that will give this information? 

No, but if you code in perl there is.

> I tried gimp_text_get_extents_fontname, but there, you have to 
> give the fontname AND the number of pixels in addition to the 
> fontname, which I don't understand. How does this work?

It works by giving much more info then you want. If it would only return
the size it would indeed be rather unnecessary.

      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [EMAIL PROTECTED] |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |

Reply via email to