nanogui: Re: FLTK font question


Previous by date: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Georg Potthast
Next by date: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Greg Haerr
Previous in thread: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Georg Potthast
Next in thread: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Greg Haerr

Subject: Re: [nanogui] FLTK font question
From: "Greg Haerr" ####@####.####
Date: 1 Aug 2011 05:46:07 -0000
Message-Id: <A330916C54DE4C0F875A68CAEA8ECD8B@winXP>

: I followed your suggestions and found that both nano-x and NXlib do print
: Umlauts to the screen. What I had to do was to implement an IBM code page
: 850 to iso8859-1translation table in my keyboard driver. Then the Umlaut
: keys were displayed.

Good.  Please send me your keyboard driver when finished, I've
added the initial DJGPP version already.



: Then I found that FLTK 1.1.10 does display the fonts with Umlauts while 
FLTK
: 1.3.0 does not. The reason is apparently that FLTK 1.1.10 loads an 
iso8895-1
: font while FLTK 1.3.0 loads an iso10646-1 font. FLTK 1.3.0 is using UTF-8
: now.

Well now you know how all the font stuff is loaded, the first issue
is determining exactly which font is loaded (differently?) between
the two FLTK versions.  As you'll recall, the font list is specified
in X11 XLFD format in fltk/src/fl_font_x.cxx.  Check that these font
tables are in fact the same or not, and then use the debug output
from the XLoadFont/XListFonts in NXLIB to determine whether
either is aliased and then exactly which font is loaded.

Once you know which font is loaded, then you'll know how it's
encoded.  If FLTK 1.3.0 is using UTF-8, then you'll have to
have a Unicode font loaded and pass GR_TFUTF8 instead
of GR_TFASCII below for it to display properly.  Otherwise,
you'll have to re-encode or convert the text string before calling
GrText.  (Yes, we could add another decoding method to
microwindow's engine/devfont.c::GdConvertEncoding(), which
may be another way to solve the problem).

Finally, you'll want to compare the differences between FLTK
versions and see whether XDrawString16 is called, instead of
or in addition to XDrawString.  The X11 spec says that only
ASCII is supposed to be passed to XDrawString.  There are
also some UTF-8 additions to X11 that may be in use, you
will have to check the FLTK 1.3.0 source for that.

Regards,

Greg



:
: I think I have to make a change to this function in nxlib\text.c:
:
: int XDrawString(Display *dpy, Drawable d, GC gc, int x, int y,_Xconst char
: *string, int length)
: {  if (length > 0)
: GrText(d, gc->gid, x, y, (char *)string, length, 
GR_TFASCII|GR_TFBASELINE);
: return 0; }
:
: How would you recommend to set the GrText flags here? Or what could I do?
:
: Georg
:
: 


Previous by date: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Georg Potthast
Next by date: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Greg Haerr
Previous in thread: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Georg Potthast
Next in thread: 1 Aug 2011 05:46:07 -0000 Re: FLTK font question, Greg Haerr


Powered by ezmlm-browse 0.20.