[Thread Prev][Thread Next][Index]

Re: [ferret_users] PyFerret: latitude labels corrupted



Hi Ryo,

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.

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.  (And my suspicion about this bug is that a non-ASCII UTF8 character is getting used with the old Hershey font.)

Karl


On Thu, May 21, 2020 at 10:04 PM Ryo Furue <furue@xxxxxxxxxx> wrote:
Dear PyFerret users,

I tried a system font for the first time.  Is there a list of available system fonts?  (Well, because it's called "system" fonts, do we have to ask the OS for the list?)

On Fri, May 22, 2020 at 9:28 AM Karl Smith - NOAA Affiliate <karl.smith@xxxxxxxx> wrote:
Actually, I just tried on my own Mac and it does show the problem when I am using the Hershey font (Ferret's font, which is the default).  
If you use a system font ("SET TEXT /FONT=Arial" for example), then there is no problem.

What I immediately noticed was the shortness of the minus sign.  I think I know the reason: the "hyphen" symbol is used for the minus sign.  This is (or used to be?) a problem for other plotting programs, too, like gnuplot.

I guess that the "hyphen" of the Hershey font is long because the symbol's main use is for minus sign not for hyphen.  I guess the ultimate solution would be to differentiate the two: the unicode Minus Sign ( "−" )and the unicode Hyphen-Minus ( "-" ).  The latter is identical to the ASCII hyphen.  (Or, the endash or emdash in the extended ASCII might be fine, because Ferret already uses the degree symbol ( " ° " ) from the extended ASCII.)

. . . Anyway, I asked the question about the font above, because there may be a font in which the hyphen symbols isr relatively long and thin.  In Arial, the symbol is rather stubby (less so than in Helvetica, though).  Perhaps I should use Courier for numerical labels. . . .

Regards,

Ryo


--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA

Note that I am working remotely (from home)

The policy of the DOC and NOAA requires me to inform you that the contents
of this message are mine personally and do not necessarily reflect any position
of the Government or the National Oceanic and Atmospheric Administration.

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

Privacy Policy | Disclaimer | Accessibility Statement