nanogui: using nano-X builtin fonts


Previous by date: 27 Jun 2001 21:32:22 -0000 mouse problem, Chen Ning-a2446c
Next by date: 27 Jun 2001 21:32:22 -0000 Re: KDGKMODE: Invalid argument, ritubhalla
Previous in thread: 27 Jun 2001 21:32:22 -0000 Re: using nano-X builtin fonts, Jordan Crouse
Next in thread:

Subject: Re: [nanogui] using nano-X builtin fonts
From: Duncan Palmer ####@####.####
Date: 27 Jun 2001 21:32:22 -0000
Message-Id: <3B3A1ABC.D5894CCC@s3group.com>

ok. i've got it sorted. in case anyone is interested in what needed
doing:

Microwindows: I had (wrongly) assumed i could just add a new .bdf file
into src/fonts/, add it to the makefile in that directory, and then use
it by calling GrCreateFont() with the name of the new font (e.g.
-Adobe-Helvetica-Bold-R-Normal--12-120-75-75-P-70-ISO8859-1), but life
is never that easy. Instead, drivers/genfont.c needed to be modified by
adding a new member to the gen_fonts[] array (this defines the name of
the new font e.g. "helvetica"). then i could go and do
GrCreateFont("helvetica",0,NULL) and work away.

FLNX changes were a matter of adding a new entry to the end of the
built_in_table[] array in src/fl_fonts.cxx with the name set to the same
as that defined in gen_fonts[]. Calls to fl_font() with the index of
this new entry in the array will then pick up the new font.

Jordan Crouse wrote:
> 
> First, you should upgrade to take advantage of bug fixes and enchancements
> (microwindows .89pre7 and flnx-0.16)

yeah i know. we've got flnx in a local cvs repository and i've been too
busy lately to take the time to import the new version - will get around
to it one day soon ;)


> 
> Next, examine src/fl_font.cxx at will.  Most of the font loading code is
> located in Fl_FontSize which is used by fl_font for most of the font work.
> I'm not the worlds biggest expert on fonts in FLNX, but I am sure that your
> answers will lie there.
> 
> Good luck,
> Jordan
> 
> On Tuesday 26 June 2001 09:43, Duncan Palmer mentioned:
> > hi all,
> >
> > I've added a builtin font to nanox by sticking a .bdf file into fonts/,
> > with all the others, and including it in the build process. I'm now
> > attempting to get flnx to use it, without success so far. Just for
> > testing, i've hacked fl_draw(), and changed the GrSetGCFont() call to
> > GrSetGCFont(fl_gc, GcCreatreFont((GR_CHAR *)"myfont", 16, NULL)), and am
> > using the "fonts" test built in the test directory to try and change to
> > my font (the fact that i haven't added it to built_in_table[] should not
> > matter since i've made fl_draw() select my font every time).
> >
> > So far, i'm not having a lot of luck (i.e. the characters printed out by
> > 'fonts' don't look like i think they should). I'm using flnx-0.15 and
> > microwin-0.89pre6 compiled to run under X. Can anyone offer me
> > suggestions as to whether what i'm doing should work, and what i might
> > be doing wrong? Should i use .ttf fonts instead? (i'd prefer not to for
> > what i'm doing).
> >
> > Cheers,
> > Dunk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

-- 
Duncan Palmer                                    
####@####.####
Software Design Engineer                          Phone:*   
+353-1-2185542
Silicon and Software Systems                      Fax:      
+353-1-2185590
* from Monday, June 25th, my number will be +353-1-2911561

Previous by date: 27 Jun 2001 21:32:22 -0000 mouse problem, Chen Ning-a2446c
Next by date: 27 Jun 2001 21:32:22 -0000 Re: KDGKMODE: Invalid argument, ritubhalla
Previous in thread: 27 Jun 2001 21:32:22 -0000 Re: using nano-X builtin fonts, Jordan Crouse
Next in thread:


Powered by ezmlm-browse 0.20.