nanogui: Scalable font support ...


Previous by date: 14 Mar 2000 22:45:54 -0000 Re: Need help, Greg Haerr
Next by date: 14 Mar 2000 22:45:54 -0000 Re: Scalable font support ..., Greg Haerr
Previous in thread:
Next in thread: 14 Mar 2000 22:45:54 -0000 Re: Scalable font support ..., Greg Haerr

Subject: Scalable font support ...
From: Martin Jolicoeur ####@####.####
Date: 14 Mar 2000 22:45:54 -0000
Message-Id: <38CEBEA8.996037C0@visuaide.com>

Hi guys,

I've been working on supporting Truetype fonts for microwindows for
awhile now (through freetype lib) and i'm proud to say I now support
truetype fonts with kerning, antialiasing and even rotated fonts ! I
also support multilanguage with utf-8 encoding (I have been able to
display chinese and japanese text, so anything's possible).

However, all this thing is in a single demo file right now ... So now, I
need to integrate it in the core library .... Microwindows font support
isn't made for scalable fonts, so a lot of work need to be done.

The FONT structure will need to be modified in such a way that
characteristics will be different according to the font type. So It
should be something like this:

struct FONT
{
 enum FONT_TYPE type;
 void* data;
}

where FONT_TYPE could be BITMAP, TRUETYPE or TYPE1, ...
and "data" will be a structure cointaining data pertaining to the
different types:

For example, for truetype, I need to store:

face
instance
charmap
rotation angle
graypalette
...

FONTID should be changed to be a pointer to such a structure, so that
when loading a font, we will return a FONTID

Here is a proposition for the Gd* functions:
I was wondering what is the benefit to have a global FONTID instead of
passing the FONTID to each routine ?
I will assume we can pass a FONTID to each function.

void GdFontSetPath(char* path)
FONTID GdFontLoad(char* filename)
void GdFontUnload(FONTID font)
void GdFontSetAntialiasing(FONTID font, BOOL aa)
void GdFontSetKerning(FONTID font, BOOL kern)
void GdFontSetSize(FONTID font, int ptsize)
void GdFontSetAngle(FONTID font, int degrees)
void GdFontSetPalette(FONTID font, PIXELVAL[] palette) /* For
antialiasing */

GdText will probably have to be modified too ... It is currently using
GetTextBits & GdBitmap but wouldn't it be better using the new drawarea
driver  ?  It is currently only implemented for 16bpp but I will need it
for fonts with the operation PSF_HAVEOP_COPY with transparency
(mandatory for rotated fonts)

GdText would draw differently according to the type in the font
structure ...

Comments please ....

Martin Jolicoeur
GVT Project
####@####.####



Previous by date: 14 Mar 2000 22:45:54 -0000 Re: Need help, Greg Haerr
Next by date: 14 Mar 2000 22:45:54 -0000 Re: Scalable font support ..., Greg Haerr
Previous in thread:
Next in thread: 14 Mar 2000 22:45:54 -0000 Re: Scalable font support ..., Greg Haerr


Powered by ezmlm-browse 0.20.