<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Andale Mono";
        panose-1:2 11 5 9 0 0 0 0 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi, Ryan – <o:p></o:p></p>
<p class="MsoNormal">The only way to do this reliably and easily in GrADS is to use the Hershey fonts, by drawing a thick version underneath the regular string. I created the attached image with the following script lines:<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">str='Houston 80'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">strsiz=0.25<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">scale=strsiz + 0.2*strsiz<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">'set strsiz 'strsiz' 'scale<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">'set lwid 13 5'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">ypos=8<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">xpos=0.5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">fn=0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">while (fn<6)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">  if (fn != 3)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">    'set font 'fn<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">    'set string 1 bl 13' ; 'draw string 'xpos' 'ypos' 'str<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">    'set string 0 bl 12' ; 'draw string 'xpos' 'ypos' 'str<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">    ypos=ypos-2*strsiz<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">  endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">  fn=fn+1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Andale Mono"">endwhile<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The problem when using Cairo fonts is that the thickness settings for ‘set string’ are ignored. The way to increase Cairo font thickness is to use a bold font. But drawing the bold version behind the regular version of a Cairo font does
 not deliver the same results; the characters don’t line up properly. The way that Cairo fonts are implemented in GrADS is lovingly referred to in the Cairo documentation as the “toy” text API – it takes UTF-8 encoded text and renders simple left-to-right text
 with no advanced features. The “toy” interface lines up very well with the GrADS algorithm: draw a letter, calculate its width, advance the position pointer by the width of the letter, draw the next letter, and so on. Building in more polished font handling
 would have required additional dependent libraries and a complete reworking of the way that strings are handled in GrADS, and that was beyond the scope of our limited resources.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--Jennifer<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt">-- <span style="color:black"><br>
Jennifer Miletta Adams<br>
ADNET Systems, Inc.<br>
NASA/GSFC, Code 610.2</span><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">Building 32, Room S159<br>
(301) 614-6070<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">gradsusr <gradsusr-bounces@gradsusr.org> on behalf of Ryan Maue <rnm02c@my.fsu.edu><br>
<b>Reply-To: </b>GrADS Users Forum <gradsusr@gradsusr.org><br>
<b>Date: </b>Saturday, September 26, 2020 at 11:23 AM<br>
<b>To: </b>"gradsusr@gradsusr.org" <gradsusr@gradsusr.org><br>
<b>Subject: </b>[EXTERNAL] [gradsusr] Outlined Font options<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Greetings, <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I am looking for any advice on how to easily implement outlined (filled) fonts e.g. black surrounding white letters and vice versa.  I have had not been able to find anything that works just right
 out of the box.  My current workaround is using Image Magick's annotate and passing a lot of information outside the GrADS script.  <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I think this would help many of us out improving the annotation of our maps & charts.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I've attached an example of my current workaround, which is what I would like to accomplish entirely within GrADS<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Cheers, Ryan<o:p></o:p></span></p>
</div>
</div>
</body>
</html>