nanogui: Font usage/setup


Previous by date: 12 Jan 2006 16:16:50 +0000 flnx 0.18 + viewml 0.22 -> problems with scrollbar, sai baba
Next by date: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Martin Kajdas
Previous in thread: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Greg Haerr
Next in thread: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Martin Kajdas

Subject: RE: [nanogui] Font usage/setup
From: "Martin Kajdas" ####@####.####
Date: 12 Jan 2006 16:16:50 +0000
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC229149D@mkmail.MKPROD.COM>

I already tried substituting -0- size parameter to -*- but that caused other problems:
- a font list showed only true type fonts and skipped the fixed ones with the same name,
- I still could not get the fonts to open

But I agree with your conclusion (that was the reason for my emails in the first place) that the true type fonts do not work with nxlib.
I also came to the similar conclusion about the fix for it.
I will modify _nxFindX11Font() to match -0- size to any size requested (1-63) and send the requested size to GrCreateFont().
This fix (if works) will be specific to my application and may not be generic enough for others but at least it will be documented here and will give some direction.

By the way, the -0- size specification comes directly from my Linux X11 fonts.dir file from my development system where my application works correctly with X11 server (instead of nano-X + nxlib on my target system)
Martin



-----Original Message-----
From: Greg Haerr ####@####.####
Sent: Tuesday, January 10, 2006 4:38 PM
To: Martin Kajdas; ####@####.####
Subject: Re: [nanogui] Font usage/setup


> The nano-X server (actually nxlib in LoadFont.c) searches for:
'-adobe-helvetica-medium-r-normal--12-0-0-0-p-0-iso8859-1'
which my application requires and the truetype font available is described
as:
'-adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1'

> They do not match and the server does not find the font correctly.
The only difference is in the font size (the app wants size 12).
However, this being the truetype font, does not specify size (equals to 0).

Looks like the second line above should be changed to:
'-adobe-helvetica-medium-r-normal--*-0-0-0-p-0-iso8859-1'.
The _nxFindX11Font() should match the pattern here, and
at least get the font.  However, code will have to be written to
substitute the requested font size into the GrCreateFont().

A quick thought suggests the way to do this would be:
1. Change the pattern matcher to remember a *-matched field.
2. If the text size matched was originally '0', substitute
the passed value ('12'), instead in GrCreateFont().

It appears we've never supported truetype fonts in NXLIB.
Actually, I think the behaviour changed when I changed
the default height param of GrCreateFont() to be 0,
rather than a hard-coded 12 that used to be there.  Thus,
non-truetype started working properly, and truetype fails,
because we never parsed the requested size (always used 12
instead).

Regards,

Greg



Previous by date: 12 Jan 2006 16:16:50 +0000 flnx 0.18 + viewml 0.22 -> problems with scrollbar, sai baba
Next by date: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Martin Kajdas
Previous in thread: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Greg Haerr
Next in thread: 12 Jan 2006 16:16:50 +0000 Re: Font usage/setup, Martin Kajdas


Powered by ezmlm-browse 0.20.