NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
60 stars 22 forks source link

pyferret freezes on strange label with system font #139

Open ryofurue opened 1 year ago

ryofurue commented 1 year ago

pyferret hangs up when you try to plot a strange label with a system font on macOS 13.4.1:

. . .
    PyFerret v7.63 (optimized)
    Darwin 19.6.0 - 12/10/21
. . .
yes? set data coads_climatology
yes? shade/L=1 SST
yes? label 180,0,0,0,0.2,"<&#64>" !!-> fine
yes? set text/font="Lucida Grande"/isiz=3
yes? label 180,0,0,0,0.2,"<&#64>" !!-> pyferret hangs up!!!

Ctrl-C doesn't work. Even if you kill the terminal window, one pyferret process stays as an orphan. You need to kill the pyferret processes from another terminal.

ACManke commented 1 year ago

Changes will be made to allow html numeric codes to be given as either "<&#nnn>" or "<#nnn>". Also make the code more robust when there are multiple html specifiers in the text of a label.

ryofurue commented 1 year ago

Just to clarify, I'm merely reporting this "freeze", which is a serious problem (similar to crash), whatever the cause is.

As to how HTML entities are expressed in PyFerret, I think it's a very minor problem. Currently,

HTML          PyFerret
<&deg;>      <&deg>, <&deg;>
<&#64;>     <#64>, <#64;>

So, the <#nnn> form is a bit inconsistent with the HTML standard, but this is a minor issue.

ACManke commented 1 year ago

Yes, the logic was sending us into an unending loop. This is now prevented for any unexpected syntax that might be in a label, and in addition, <&#nnn> is equivalent to <#nnn>.

Addressed in ppl/complot/symbel.F and additional tests added, bn_setting_text.jnl