[Thread Prev][Thread Next][Index]

Re: [ferret_users] pyferret fonts: italicize only a part of text?



Billy and Ansley,

Being very happy with the regular Ferret fonts, I haven't bothered to learn the new PyFerret ones. The old ones still work fine in PyFerret, including font changes within labels, subscripts, superscripts, etc.

The old fonts work "fine".  I agree with you 100%.

I use new fonts because they are much more versatile and easier to use.
 
So why not use the old-style fonts for situations when this will be an issue?

You have to use the old-style fonts for a situation like this.  But, switching between the two styles is annoying because you have to change many things including how you specify Greek characters, special symbols, etc.

Ryo
---------
Here are some points where the new fonts are more convenient.

Not all variants are available in the traditional font set.  For example, there is no slanted (oblique) variant for Hershey's Simplex Roman.

The modern fonts form "families".  (For simplicity, the following discussion lacks precision.)  For example, the Times family has two parameters

- weight:  light, regular, bold

- slandedness: upright or slanted

So, you have 6 variants in total under Times and each of these variants includes Latin and Greek alphabets and other symbols like ∇ϕ .

Using PyFerret's new fonts, therefore, you can even print something like ∇ϕ  in slanted bold Courier!

Moreover, if you know HTML, you realize that you can specify special symbols much more easily in the new style

set var/title="<&nabla><&phi>"  somevar

to get ∇ϕ .

In this context, I'm saying it would be nice to be able to switch weight and slantedness within a single character string, as you do in HTML.


On Mon, Jun 21, 2021 at 5:31 PM Ansley Manke <a.c.manke@xxxxxxxxx> wrote:

Hi Ryo,

The capability to change font characteristics within a label isn't implemented for PyFerret fonts.

You could probably do this kind of thing using separate labels, but it'd be a bit laborious,


set text/font=Times
. . . .
label 180,0,0,0,0.3,"upright"


set text/font=Times/italic
label 182,0,0,0,0.3," italic"

cancel text
set text/font=Times
label 184,0,0,0,0.3," upright"

where you'd need to fiddle with the locations to put one word after the other.

If using page "inches" to locate text instead of world coordinates, the LABWID function might be able to be used to put one piece of text after the previous one, but be aware that the function estimates the width of the label and so the location might be inaccurate for some fonts.


On 6/20/2021 7:34 PM, Ryo Furue wrote:
Dear Ferret users,

I'm trying to find ways to print part of a single piece of text in italics:

set text/font=Times
. . . .
label 180,0,0,0,0.3,"upright italic upright"

I thought "upright <i>italic</i> upright" would do that but found it doesn't.  (<i> is the HTML tag for italicization.)

In the classical (Hershey) font set, you change fonts using the "@" font commands:

"@DRupright @CIitalic @DRupright"

How do we do this on PyFerret's new font system?

I'm using PyFerret v7.63 on macOS 11.4 .

Ryo

!--- a self-contained example ---
set text/font=Times
use coads_climatology
fill/l=1 sst
label 180,0,0,0,0.3,"upright <i>italic</i> upright"



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115 USA

william.s.kessler@xxxxxxxx
Tel: 206-526-6221
Fax: 206-526-6744

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

Privacy Policy | Disclaimer | Accessibility Statement