xforms-development
[Top][All Lists]
Advanced

[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: Fri, 11 Apr 2014 18:16:55 +0530

Hi,

>The problem is that you don't have a '?' in the size field (the
>forth of your stars) of the font name. If you change it to
>
>            "-*-dejavu sans-medium-r-*-*-*-?-*-*-*-*-*-*"
>
>(assuming that you actually have a scalable 'dejavu sans-medium'
>font) setting different sizes via the lstyle should work.

I think my eyes just melted, because that fixed that problem! Thanks a lot.

>I've got a quite large collection of fonts but no dejavu sans
>as a traditional X11 font. I've got a dejavu sans as a true
>type font, but XForms can't use them. That's one of the things
>I would like to change when I've got a bit more of time (though,
>it will make it depend on another library, which might lead to
>new problems:-(

Hmm. How difficult on a scale of 1 to 10 do you think this will be?
I'd like to help but I'll have to look at a tutorial of sorts on TTF
to see if I can make head or tails of it. I probably won't understand
a thing lol.

I think adding TTF support to XForms will make it a lot better though.

>I can't reproduce it at the moment, for me it crashes with
>a X error before it gets that far when he replacement font
>is used;-) I'll take a good look!

So it crashed for you too, but in a different way? I am using the
-stable library so it crashed on the 10th or 13th call to
fl_set_object_lsize().

Do you know the reason behind the font-caching? Is it really that slow
to fetch a new font struct that it needs to be cached? I'll go re-read
the code, It'll take me some time to understand the whole logic.

Best regards & thanks

Sunny


On 11/04/2014, Jens Thoms Toerring <address@hidden> wrote:
> Hi,
>
> On Fri, Apr 11, 2014 at 12:06:30PM +0530, Sunny wrote:
>> I'm trying both the default font and a newly added one (DejaVu Sans).
>> I was trying to change the the label size that is drawn on buttons by
>> default - I am not using any text drawing function directly.
>>
>> Actually none of the lsizes work on my system for any font (lstyle).
>> At first I thought that the default font was crappy and had no sizes,
>> but this doesn't seem to be the case.
>
>> void setup_dejavu_font()
>> {
>>     fl_set_font_name(DEJAVU_SANS,
>                        "-*-dejavu sans-medium-r-*-*-*-*-*-*-*-*-*-*");
>> }
>
> The problem is that you don't have a '?' in the size field (the
> forth of your stars) of the font name. If you change it to
>
>             "-*-dejavu sans-medium-r-*-*-*-?-*-*-*-*-*-*"
>
> (assuming that you actually have a scalable 'dejavu sans-medium'
> font) setting different sizes via the lstyle should work.
>
>> So for variety, I changed the font to DejaVu Sans which is a very
>> popular font with many sizes. And indeed on a word processor, I can
>> set the size for this font to anywhere between 2 to 72.
>
> Installed means that when you do
>
>    xfd -font "-*-dejavu sans-medium-r-*-*-*-?-*-*-*-*-*-*"
>
> from the command line you get shown this font (and not some other
> font).
>
> I've got a quite large collection of fonts but no dejavu sans
> as a traditional X11 font. I've got a dejavu sans as a true
> type font, but XForms can't use them. That's one of the things
> I would like to change when I've got a bit more of time (though,
> it will make it depend on another library, which might lead to
> new problems:-(
>
>> If I set the 8th field of the DEJAVU font-string to 80, then the font
>> shows up in a nice regular size. Not the ugly 120 which just looks
>> bad.
>
> With the '*' instead of a '?' in the size field first fixed
> sized font Xlib returns will be used - that's probably this
> 120 font. If you set one of the fields you reduce the se-
> lection Xlib has quite a bit and it then may pick a font
> that looks more what you expected.
>
>> Also, the library for some reason crashes if you keep on increasing
>> the counter value for 10 times or more. It seems to be related to the
>> way the font is cached (???) in fonts.c. I have attached the backtrace
>> as a text file - could you please have a look?
>
> I can't reproduce it at the moment, for me it crashes with
> a X error before it gets that far when he replacement font
> is used;-) I'll take a good look!
>
>                           Best regards, Jens
> --
>   \   Jens Thoms Toerring  ________      address@hidden
>    \_______________________________      http://toerring.de
>



reply via email to

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