FontProperties being ignored...

All,

I just submitted bug #2963827 detailing this, but thought
that I would echo the problem here…

When plotting annotations and specifying the FontProperties
to use, the specified values are completely ignored. See the attached script
and image for an example. Am I doing something inherently wrong, or is this
really a bug?

Thanks,

–James Evans

textFormat.png

test_textFormat.py (2.2 KB)

Do you have fonts whose family name is "sans serif"?
Maybe you meant "sans-serif"?

"sans-serif" searches for fonts whose family name is in
rcParams["font.sans-serif"], but "sans serif" only search for "sans
serif".

I don't think it has anything to do with annotation.
Check if findfont gives you a correct font.
Please report back with matplotlib version etc., if findfont finds a
correct font but annotation still shows with a wrong font.

Regards,

-JJ

import matplotlib.font_manager
fm = matplotlib.font_manager.fontManager
print matplotlib.font_manager.findfont(normalFont)

···

On Thu, Mar 4, 2010 at 7:07 PM, James Evans <jrevans1@...310...> wrote:

All,

I just submitted bug #2963827 detailing this, but thought that I would echo
the problem here…

When plotting annotations and specifying the FontProperties to use, the
specified values are completely ignored. See the attached script and image
for an example. Am I doing something inherently wrong, or is this really a
bug?

Thanks,

--James Evans

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

It should also be noted that attributes like "weight" and "stretch" are only hints for the purpose of finding a font. That is, if you request a bold version of a font, and it does not exist, the closest matching font will be used instead. matplotlib (more specifically freetype) does not do "font synthesis" to generate a pseudo-bold font or pseudo-compressed font if one can not be found. So for example, the "condensedFont" set of properties you defined will not return a condensed font unless such a font exists on your system.

Mike

James Evans wrote:

···

All,

I just submitted bug #2963827 detailing this, but thought that I would echo the problem here�

When plotting annotations and specifying the FontProperties to use, the specified values are completely ignored. See the attached script and image for an example. Am I doing something inherently wrong, or is this really a bug?

Thanks,

--James Evans

------------------------------------------------------------------------

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
------------------------------------------------------------------------

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA