nanogui: How to add new font?


Previous by date: 24 Apr 2001 02:41:20 -0000 Need I compile libwww for ARM when I build viewml for ARM??, Jiang Jing
Next by date: 24 Apr 2001 02:41:20 -0000 Menu query on Microwindows, Sachin
Previous in thread: 24 Apr 2001 02:41:20 -0000 Re: How to add new font?, Greg Haerr
Next in thread:

Subject: RE: How to add new font?
From: Gary James ####@####.####
Date: 24 Apr 2001 02:41:20 -0000
Message-Id: <20010423224202.A832@pc.twcny.rr.com>

Hi Devaraj,

No, you don't want to use GdCreateFont() if you're using nano-X. You should
stick with the Grxxxx functions.

When you use GdCreateFont() you end up with a PMWFONT type. You can not use
this type with the nano-X font selection functions. For example GrText()
uses the font in the specified GC. The only way to specify a font to a GC
is with GrSetGCFont() and that needs a GR_FONT_ID type. 

GdCreateFont()and GrCreateFont() take pretty much the same parameters. Take
a look at GrCreateFont() in ".../src/nanox/srvfunc.c".

You should try to stick with the Grxxxxxx functions when using nano-X. Once
and a rare while you might need to make your own wrapper for something at
the Gdxxxxx level, but pretty much everything is covered already.

If it's any help I've put together a nano-X API reference document that
covers pretty much everything at the nano-X API level (all the Grxxxx
functions and GR_XXXXX structures). You can get it here:
http://home.twcny.rr.com/embedded/microwin/


Gary James
####@####.####
http://home.twcny.rr.com/embedded/


On Mon, 23 Apr 2001 10:24:35 Srinivasa Devaraj wrote:
> 
> 
>    Can we use GdCreateFont() for microwindows font creations
>    Devaraj
> 
> > -----Original Message-----
> > From:	Gary James ####@####.####
> > Sent:	Monday, April 23, 2001 3:12 AM
> > To:	yi yang
> > Cc:	nano-X maillist
> > Subject:	Re: How to add new font?
> > 
> > On Sun, 22 Apr 2001 23:49:39 yi yang wrote:
> > > Hi,
> > >     I only find two kinds of fonts in nanoX -- 11
> > > pixels and 14 pixels. 
> > >     If I want to add some new font, what should I do? 
> > > 
> > > Best Regards,
> > > Yi Yang
> > 
> > 
> > Here's some notes on how to add TrueType fonts to Microwindows.
> > 
> > 1) Get, build and install the FreeType library version 1.3.1. I don't
> know
> > if the newer 2.x versions will work. You can get version 1.3.1 from the
> > Microwindows FTP
> > site: ftp://microwindows.censoft.com/pub/microwindows/
> > 
> > 2) Modify the Microwindows cinfig file in ".../microwin/src/"
> directory.
> > Change "HAVE_FREETYPE_SUPPORT" to "Y". Modify "INCFTLIB" and "LIBFTLIB"
> to
> > point to the directories that contain the FreeType libraries. On my
> system
> > it was "INCFTLIB = /usr/local/include" and "LIBFTLIB =
> > /usr/local/lib/libttf.so". Re-build and re-install Microwindows.
> > 
> > 3) Create a directory "/usr/local/microwin/fonts/" on your target
> machine
> > to hold TrueType fonts. You can get some free truetype fonts from this
> > site: http://www.microsoft.com/typography/fontpack/default.htm
> > 
> > 4) Load the fonts at runtime with the following commands (for nano-X):
> > font = GrCreateFont ((GR_CHAR*) "arial", 8, NULL);
> > font = GrCreateFont ((GR_CHAR*) "comic", 12, NULL);
> > font = GrCreateFont ((GR_CHAR*) "comic", 24, NULL);
> > 
> > 
> > Gary James
> > ####@####.####
> > http://home.twcny.rr.com/embedded/index.htm
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ####@####.####
> > For additional commands, e-mail: ####@####.####
> 


Previous by date: 24 Apr 2001 02:41:20 -0000 Need I compile libwww for ARM when I build viewml for ARM??, Jiang Jing
Next by date: 24 Apr 2001 02:41:20 -0000 Menu query on Microwindows, Sachin
Previous in thread: 24 Apr 2001 02:41:20 -0000 Re: How to add new font?, Greg Haerr
Next in thread:


Powered by ezmlm-browse 0.20.