[Thread Prev][Thread Next][Index]

[ferret_users] PyFerret fonts



Hi,

I'm quoting this part of this thread which started talking about something else, but has turned into a discussion of PyFerret fonts and system fonts, so I thought I'd start a new thread to get the information in front of everyone for those who may not have delved into this yet:

Just for reference, the documentation about PyFerret fonts is here:

https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/SET#_SETTEXT

and a summary of PyFerret syntax that extends or changes Ferret capabilities is here:

https://ferret.pmel.noaa.gov/Ferret/documentation/pyferret/pyferret-quick-start-notes

When the documents talk about SET TEXT/FONT= they say, "The fonts available are those available to the Python packages".  This does generally mean the ones available on the system, so we'll add that information to these pages.

-Ansley

On 5/23/2020 1:45 AM, Ryo Furue wrote:
Hi Karl,

On Sat, May 23, 2020 at 4:21 AM Karl Smith - NOAA Affiliate <karl.smith@xxxxxxxx> wrote:
For XWindow systems, the command-line program xfontsel can be used to show fonts (with way too many options because this existed before scalable fonts - look under the 'fmly' options).

On my Mac the command-line program "atsutil font -list" gives a list of fonts.  (I just did an "apropos font" to discover the atsutil program, so I am not sure if this is the best answer.)  Note that if you specify a font that is not present, the program (or rather the graphics library) will substitute whatever it thinks is an appropriate substitute.

Thanks!  That means that all fonts the OS recognizes can (in principle) be used.  That's useful information.  (And I hope you will write it in the official PyFerret manual.)

In that case, macOS has a utility called "Font Book" in the "Applications" folder.   I found a bewildering number of fonts!

This application shows samples for each font.  Unfortunately, the samples don't include the hyphen character.  (Understandably.  Nobody would look into the font gallery specifically to examine the hyphen character!)
 
When using system fonts, especially under Python 3.x, unicode (UTF8) is used.  So I think (but I have not tested this) you should be able to specify UTF8 characters and not be limited to ASCII.

So, in the future, it would be nice if PyFerret will use the unicode Minus Sign for the minus symbol on the axes and colorbar.

  (And my suspicion about this bug is that a non-ASCII UTF8 character is getting used with the old Hershey font.)

I found that the PDF file PyFerret generates includes the "real" degree symbol (" ° ") from unicode.  This symbol is non-ASCII, although It's in the Extended ASCII set.  But I guess Hershey is fine with it?

Regards,
Ryo

-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement