[gradsusr] text strings with accented vowels
Jennifer M Adams
jadams21 at gmu.edu
Tue Aug 29 11:28:50 EDT 2017
Hi, Julio —
I certainly do appreciate your diligence. The hershey fonts won’t support the diacritical marks you are asking for, and it seems that GrADS’s use of the Cairo text API won’t either. Please see https://developer.gnome.org/cairo/stable/cairo-text.html#cairo-text.description. Your idea to edit the .ps or .eps files may work, or you could draw the marks separately, like this:
draw string 5 5 n
draw string 5 5.55 ~
[cid:EC533688-7255-49FA-A10B-505AB278F880]
draw string 5 5 e
set string 1 c 1 270
draw string 4.7 5.4 `
[cid:525A23CF-2EF8-4F8C-ABD4-922BDE5AB883]
—Jennifer
On Aug 28, 2017, at 4:43 PM, Julio Figueroa <jcfiguero at gmail.com<mailto:jcfiguero at gmail.com>> wrote:
Thanks all for the help,
I wrote a little bash script that use different LC_CTYPE an iterates over all the fonts in /usr/share/fonts to produce a PNG with the string "[Año á é í ó ú AÑO]". Unfortunately the fonts where not understood by grads. The script iterates all the fonts and assign the fonts in grads under the font numbers 10 to 99. I attached the script in case someone needs to try with different fonts.
I also noticed that when drawing strings with accented vowels after setting a font (10-99), the display will freeze, and not even reinit will help. I had to do Ctl+D.
You can reproduce the bug with:
set font 0
draw string 1 1 TéXT 1
set font 5
draw string 1 2 TéXT 2
set font 10 file /usr/share/fonts/default/ghostscript/putr.pfa
draw string 1 3 TéXT 3 * It will not longer allow to draw information after this command.
set font 0
draw string 1 4 TéXT 4
clear
reinit
set font 0
draw string 1 1 TéXT 5
Perhaps my solution would be to produce my plots in EPS and then with Imagemagick replace the strings to Spanish.
However, I wonder if recompiling grads using an UTF-8 font will make any difference.
Cheers,
Julio
On 26 August 2017 at 07:09, Jennifer M Adams <jadams21 at gmu.edu<mailto:jadams21 at gmu.edu>> wrote:
I don’t know how to do this with Hershey Fonts, but you could probably find a font file that will have these accented characters. —Jennifer
> On Aug 24, 2017, at 3:05 PM, Julio Figueroa <jcfiguero at gmail.com> wrote:
>
> Hi All,
>
> I want to add Spanish or French words to my grads plots. Using the following command just draw an empty space within the letters A and o.
>
> draw string 1 2 Año.
>
> I wonder if you have any suggestions in how to draw strings with accented characters, like á, é, í, ó, ú, à, è, ì, ò, ù, Ñ or ñ.
>
> I am using the binary distribution of grads 2.1.1.b0 for linux.
>
> I'll appreciate any help.
>
> Julio
> --------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
--
-------------------------------------------------
Julio Figueroa
Oceanólogo / Oceanographer
jcfiguero at gmail.com
<search_fonts.sh>_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170829/4b4d44e1/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-08-29 at 11.27.22 AM.png
Type: image/png
Size: 5357 bytes
Desc: Screen Shot 2017-08-29 at 11.27.22 AM.png
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20170829/4b4d44e1/attachment-0002.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-08-29 at 11.26.09 AM.png
Type: image/png
Size: 5656 bytes
Desc: Screen Shot 2017-08-29 at 11.26.09 AM.png
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20170829/4b4d44e1/attachment-0003.png
More information about the gradsusr
mailing list