Hi all
I'm emailing about font selection in general, but particularly with wxWidgets
and using the symbol font with freetype on Windows.
I guess the easiest of these subjects is the symbol font using freetype. I've
just discovered that plfreetype renders the wrong characters when using the
symbol font under Windows. A quick google revealed that this is a pretty common
problem that applies to many symbol-like fonts on Windows - it's caused by the
fact that these fonts don't include a unicode character map which is looked for
by default by freetype. If it doesn't find one then one of the other character
paps must be selected manually. I've just generated a couple of line long patch
which simply selects the first character map in the file if the unicode map
isn't found - please find attached. This seems to work for the symbol font. It
seems that font files can and usually do contain multiple maps and I'm not sure
how to go about picking the "best" one, but at least this patch gives freetype
a fighting chance.
The other item - and the item i was working on when I found the symbol font
problem - is that wxWidgets doesn't have a symbol type and because of this
plplot uses the sans style when a symbol type is supplied in the fci. Therefore
there is currently no way to select any symbol font. I also wanted to have a
bit more control over the font selection, particularly for picking symbols for
use in plotting. So I wondered if there was any appetite for a function in the
API to set the font face by name?
I recently finished modifying my copy of plplot to enable this for wxWidgets
and plfreetype with a function sfontf (char * facename) which tries to use the
supplied font facename (in the wxWidgets version the font name is supplied, for
plfreetype the full path of the font file is supplied) with the style
(bold/italic etc) set by the fci using sfont. If loading this font fails then
it falls back to just using the fci. It also allows use of the escape
#{fontname} to change font mid string. If anyone thinks that this is useful
then I'm happy to supply the changes as a patch or work on it further if anyone
has any suggestions for a better interface.
All the best
Phil
winsymbol.patch
Description: Binary data
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
