From: Alan W. I. <ir...@be...> - 2017-10-13 22:59:21
|
On 2017-10-13 15:26-0700 Alan W. Irwin wrote: > On 2017-10-13 16:11+0200 Alaric Senat wrote: > >> Hi, >> >> I'm trying to simply change the font of the texts in plplot by another one, >> I found a lot of things in the doc' to change the font in the way to make >> it >> Italic or Serif etc. But I'm wondering if there is no way to specify a font >> file >> like a .ttf, for example. It's good to know that I'm using Plplot with the >> wxwidgets >> Driver. >> >>> From what I read in the documentation it seem's that i'm limited by the >> 30 possibilities of plplot FCI system. > > Yes. PLplot uses generic fonts. I got that idea from the SVG > graphics format, and all of the pango/cairo, Qt, and wxWidgets suites of > graphical libraries. See the first part of > <http://docs.wxwidgets.org/3.1/overview_font.html> for the generic > fonts used by wxwidgets. > > What generic fonts mean in practice is for each (unicode) > glyph requested by the PLplot users via the UTF-8 encoded string to be > plotted, the operating system supplies that glyph using the "best" > system font of the particular generic kind (Sans, Serif, etc.) > requested by the PLplot user. Where "best" is typically defined by how > fontconfig is set up. > > The results are normally good. For example, see > <http://plplot.org/examples.php?demo=02> and click > on the screenshots of the two pages of that example > which show what the (PLplot default) sans serif, upright, > normal weight font looks like. (Those screenshots > were generated by -dev pngcairo, but all cairo and > qt results look like this for that example.) > > To check what wxwidgets does in this regard I > ran > > examples/c/x02c -dev wxwidgets > > and the result is an italic font, i.e., not what > is intended at all for that example! So as a result > of this discussion, I have found a bug in the font > selection by -dev wxwidgets, and once that is sorted > out, I suspect you will be much more satisfied with > the generic font choice for -dev wxwidgets. > > To be continued by discussion in the plplot-devel mailing > list, but once the bug is resolved, I will let you > know here. Oops. Never mind. There is no bug. That example calls plfont(4) which corresponds (for unicode fonts) to asking for a generic script font which -dev wxwidgets supplies. In this case, the other device drivers (e.g., qt, cairo) do not have generic script font capabilities implemented (likely due to library limitations) so they fall back to using generic sans for this case which obviously looks very different than what is produced by -dev wxwidgets. So getting back to your original request, if you are not satisfied with how generic fonts look on your platform for -dev wxwidgets then you might want to try to set up fontconfig a different way to favor your preferred fonts. 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 __________________________ |