Content-Type: multipart/alternative; boundary="-1476983308-1947239894-1341413296=:17464" ---1476983308-1947239894-1341413296=:17464 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi all=0A=A0=0AI'm emailing about font selection in general, but particular= ly with wxWidgets and using the symbol font with=A0freetype on Windows.=0A= =A0=0AI guess the easiest of these subjects is the symbol font using freety= pe. 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 gener= ated a couple of line long patch which simply selects the first character m= ap 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 "bes= t" one, but at least this patch gives freetype a fighting chance.=0A=A0=0AT= he 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=A0because of thi= s plplot uses the sans style when a symbol type is supplied in the fci.=A0T= herefore there is currently no way to select any symbol font.=A0I also want= ed to have a bit more control over the font selection, particularly for pic= king symbols for use in plotting. So I wondered if there was any appetite f= or a function in the API to set the font face by name?=0A=A0=0AI recently f= inished modifying my copy of plplot to enable this for wxWidgets and=A0plfr= eetype with a function sfontf (char * facename) which tries to use the supp= lied font facename (in the wxWidgets version the font name is supplied, for= plfreetype the full path of the font file is supplied)=A0with the style (b= old/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 #{fo= ntname} to change font mid string.=A0If anyone thinks that this is useful t= hen I'm happy to supply the changes as a patch or work on it further if any= one has any suggestions for a better interface.=0A=A0=0AAll the best=0A=A0= =0APhil ---1476983308-1947239894-1341413296=:17464 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
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 cha= racters when using the symbol font under Windows. A quick google revealed t= hat 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 unico= de 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 firs= t 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 a= bout picking the "best" one, but at least this patch gives freetype a fight= ing 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 whe= n a symbol type is supplied in the fci. Therefore there is currently n= o way to select any symbol font. I also wanted to have a bit more cont= rol over the font selection, particularly for picking symbols for use in pl= otting. So I wondered if there was any appetite for a function in the API t= o set the font face by name?
 
I recently finished= modifying my copy of plplot to enable this for wxWidgets and plfreety= pe 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 fa= ils then it falls back to just using the fci. It also allows use of the esc= ape #{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 fur= ther if anyone has any suggestions for a better interface.
 =
All the best
 
Phil
<= /html> ---1476983308-1947239894-1341413296=:17464--