On 2012-07-04 07:48-0700 phil rosenberg wrote: > 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.
Thanks, Phil, for your interest in plfreetype. The knock against it for years is that nobody has wanted to step forward to maintain it, but if you are willing to do that we should encourage you as much as possible. :-) Our cairo device driver uses the pango and cairo libraries to render text, and one of those libraries (I think the cairo one) uses Fontconfig to select fonts. Fontconfig is a really sophisticated solution that for each unicode glyph in a string searches system font files for the best rendering solution for the generic sans, serif, etc., fonts requested by Plplot. Fontconfig works on all platforms including Windows. I strongly suggest you check these statements for yourself by downloading the gtk+ binary packages for Windows from http://www.gtk.org/download/win32.php (or experimentally at http://www.gtk.org/download/win64.php if you have a pure 64-bit Windows system where you prefer not to run 32-bit applications/libraries). That binary download includes pango, cairo, and fontconfig binary packages. After such download, you can configure a PLplot build to use those libraries for our cairo device driver and check the quality of the font selection at run time for your needs. (BTW, if you have any trouble with such a PLplot build, you can contact me off list for help since I have some experience with cairo device drivers on the Wine [free version of Windows] platform.) Assuming you really like those cairo device driver font-selection results on Windows, I suggest that your best method of dealing with font-selection issues on all platforms with plfreetype is to start using fontconfig in that case as well. Would you be willing to look further at that general solution? That said, a partial improvement for plfreetype font-handling that is nonobtrusive and which doesn't cause issues on any platform is also acceptable in the short term. But I will leave it to others to evaluate your patch with those constraints in mind since I don't have time to do that myself. > > 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? Actually, with plfreetype there is already a way to force PLplot to use specific font files both at cmake time and also run time. There is dated documented in http://plplot.sourceforge.net/docbook-manual/plplot-html-5.9.9/characters.html concerning these plfreetype capabilities. I know it is dated since the references in there to ./configure options need to be changed to the equivalent cmake options. Also, since it is dated I would suggest you double-check the plfreetype code to make sure these font file selection capabilities are still intact and work on Windows. Of course, to my mind the best solution is to completely throw out these extraordinarily clumsy font file selection possibilities (unique to plfreetype) and move to the much better solution of using fontconfig which for all platforms does precise glyph selection (as opposed to font file selection) automatically and on the fly, see discussion above. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ 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 Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel