[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Help with XForms

From: Sunny
Subject: Re: [XForms] Help with XForms
Date: Thu, 10 Apr 2014 15:13:04 +0530

Hi all,

I'm still in the middle of writing a custom button, but I seem to be
stuck on font sizes.

I am not able to change font/label sizes with fl_set_object_lsize(). I
understand that not all sizes may be installed for that font on my
system, but none of the FL_HUGE_SIZE, FL_LARGE_SIZEs worked.

My workaround is adding a fl_get_font_name() function which fetches
the font-string and modifies the width and height field directly and
set it via fl_set_font_name().

Is there a better alternative?

Oh, while we are on this subject, can we add a corresponding
fl_get_font_name() function to the library? It doesn't have one by

--- a/fonts.c
+++ b/fonts.c
@@ -231,6 +231,18 @@ fl_set_font_name( int          n,
     return try_get_font_struct( n, FL_DEFAULT_SIZE, 1 ) ? 0 : -1;

+char *
+fl_get_font_name( int index )
+    if ( index < 0 || index >= FL_MAXFONTS )
+    {
+        M_warn( __func__, "Bad font index" );
+        return NULL;
+    }
+    return fl_fonts[index].fname;

  * Add a new font (indexed by n) or change an existing font.

On 08/04/2014, Jens Thoms Toerring <address@hidden> wrote:
> Him
> On Tue, Apr 08, 2014 at 10:14:42PM +0530, Sunny wrote:
>> I'll see if I can come up with a FL_MY_BEAUTIFUL_BUTTON as this sounds
>> most reasonable for now. I'm still a bit new to programming so it
>> might take me some tries to get it right. I'll post it eventually.
> In chapter 4 of the documentation there's some explanation
> of how it could be done. And, of course, the alreadu exis-
> ting objects could be of some help (though, admittedly,
> the code isn't what I would consider beautiful;-) Don't
> hesitate to ask about everything you find hard to under-
> stand - this could also help with improving the documen-
> tation!
>                        Best regards, Jens
> --
>   \   Jens Thoms Toerring  ________      address@hidden
>    \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]