nanogui: TTF font weight


Previous by date: 10 Jul 2007 18:07:05 +0100 Re: problem with japanese fonts, Greg Haerr
Next by date: 10 Jul 2007 18:07:05 +0100 client/server nano-x howto ??, Islam Samir
Previous in thread: 10 Jul 2007 18:07:05 +0100 TTF font weight, Uwe Klatt
Next in thread: 10 Jul 2007 18:07:05 +0100 Re: TTF font weight, Uwe Klatt

Subject: Re: [nanogui] TTF font weight
From: "Greg Haerr" ####@####.####
Date: 10 Jul 2007 18:07:05 +0100
Message-Id: <0c2f01c7c314$bb23db40$6401a8c0@winXP>

: But I found no way to display BOLD fonts with a normal TTF-file.
: The fnWeight-member of CreateFont() should influence the "weight" of the 
: resulting font, but it doesnt work...

Uwe - 

Looks like a small amount of code will need to be written.

This is normally handled in mwin/winfont.c::CreateFontIndirect(),
where a 'b' is appended to the facename (just like Windows does).
I'm not sure what happens when this 'b' is appended to your
.ttf filename... ! (please investigate)

The .ttf handling continues in engine/devfont.c::GdCreateFont(),
where the PMWLOGFONT your application created is
passed.  It looks like you'll need to create a new
MWTF_BOLD attribute and or it into the 'fontattr'
variable, like the lfUnderline handling.  Then, in the
.ttf handler engine/font_freetype[2].c, you'll inspect
the attr parameter in freetype_createfont(), and
tell freetype to bold the font.

If you get this working, please send me a "diff -urN" patch.

Thanks!

Regards,

Greg


Previous by date: 10 Jul 2007 18:07:05 +0100 Re: problem with japanese fonts, Greg Haerr
Next by date: 10 Jul 2007 18:07:05 +0100 client/server nano-x howto ??, Islam Samir
Previous in thread: 10 Jul 2007 18:07:05 +0100 TTF font weight, Uwe Klatt
Next in thread: 10 Jul 2007 18:07:05 +0100 Re: TTF font weight, Uwe Klatt


Powered by ezmlm-browse 0.20.