<div dir="ltr"><div class="gmail_default" style="font-size:small">Gin Lin,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The actual strings of the stroked characters will NOT be in the file, because they are drawn with line strokes instead of actual characters.  This gives you a better looking font than the non-stroked fonts.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As an example, I wrote an NCL script that creates two text strings: one written with a stroked font, and one written with a non-stroked font.  See the attached text.ncgm file.  I also included the text.ncl NCL script just in case.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that the string &quot;Stroked font&quot; is of much better quality than the string &quot;Non-stroked font&quot;. That&#39;s because the stroked font was drawn with filled polygons, rather than simple character strings.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Further, if you run:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">ctrans -d CTXT text.ncgm &gt; text.ctxt</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and look at the text.ctxt file, you will see the polygon draw calls, which look like this:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="monospace, monospace">INTERIOR STYLE</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>interior style  -&gt;  solid</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><br></font></div><div class="gmail_default" style=""><font face="monospace, monospace">POLYGON</font></div><div class="gmail_default" style=""><font face="monospace, monospace">       <span class="" style="white-space:pre">        </span>206 points follow:</font></div><div class="gmail_default" style=""><font face="monospace, monospace">                P(0)    -&gt;  11649,  26570</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>        P(1)    -&gt;  11649,  26601</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span class="" style="white-space:pre">                </span>P(2)    -&gt;  11646,  26632</font></div><div style="font-size:small"><font face="monospace, monospace">. . .</font></div><div style="font-size:small"><br></div><div style="font-size:small">If you go further down in the text.ctxt file, you will see:</div><div style="font-size:small"><br></div><div style=""><div style=""><font face="monospace, monospace">TEXT</font></div><div style=""><font face="monospace, monospace">        position        -&gt;   5851,  19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -&gt;  final</font></div><div style=""><font face="monospace, monospace">        string          -&gt; &quot;N&quot;</font></div><div style=""><font face="monospace, monospace"><br></font></div><div style=""><font face="monospace, monospace">TEXT</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>position        -&gt;   7255,  19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -&gt;  final</font></div><div style=""><font face="monospace, monospace">        string          -&gt; &quot;o&quot;</font></div><div style=""><font face="monospace, monospace"><br></font></div><div style=""><font face="monospace, monospace">TEXT</font></div><div style=""><font face="monospace, monospace">        position        -&gt;   8659,  19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -&gt;  final</font></div><div style=""><font face="monospace, monospace">        string          -&gt; &quot;n&quot;</font></div><div style=""><font face="monospace, monospace"><br></font></div><div style=""><font face="monospace, monospace">TEXT</font></div><div style=""><font face="monospace, monospace">        position        -&gt;  10064,  19660</font></div><div style=""><font face="monospace, monospace">        final/not final -&gt;  final</font></div><div style=""><font face="monospace, monospace">        string          -&gt; &quot;-&quot;</font></div><div style=""><font face="monospace, monospace"><br></font></div><div style=""><font face="monospace, monospace">TEXT</font></div><div style=""><font face="monospace, monospace">        position        -&gt;  11468,  19660</font></div><div style=""><font face="monospace, monospace">        final/not final -&gt;  final</font></div><div style=""><font face="monospace, monospace">        string          -&gt; &quot;s&quot;</font></div><div style="font-size:small"><br></div><div style="font-size:small">If you look at the &quot;string&quot; word, you will see that this is the start of the &quot;Non-stroked font&quot; string.</div><div style="font-size:small"><br></div><div style="font-size:small">So, I&#39;m sorry to say that there&#39;s no way to determine which strings are associated with the polygon draws, especially if you have other plot elements, like axes, tickmarks, etc.  These are all drawn with polygons and/or polylines.</div><div style="font-size:small"><br></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 25, 2015 at 2:22 AM,  <span dir="ltr">&lt;<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><span class=""><div>Hi, Mary.</div><div><br></div><div>Thanks for your reply.</div><div><br></div></span><div>Do you mean these strings are still in the file, they are just stroked because they use high quality fonts?</div><div><br></div><div>If so, do I have no way to know how they are defined in the file?</div><div><br></div><div>I mean, if I don&#39;t know where they are,</div><div><br></div><div>I can&#39;t find where the Idt and our AWIPS program handle them, not to mention solving our problem. </div><div><br></div><div><br></div><div><br></div><div>I constructed the text file with command: &quot;ctrans -d CTXT (binary file name) &gt; (output text)&quot;</div><div><br></div><div>Is there any option that can make the high quality font information be viewable?</div><div><br></div><div>Or the only way is going to ask the person who generated these binary files?</div><div><br></div><div><br></div><div><br></div><div>Thank you.</div><div><br></div><div>Gin Lin.<br><br><font color="#990099">-----Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; 撰寫:-----</font></div><div style="padding-left:5px"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px">收件人: <a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a><br>寄件人: Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;<br>日期: 09/25/2015 12:02上午<br>副本抄送: <a href="mailto:bobo.wang@iisigroup.com" target="_blank">bobo.wang@iisigroup.com</a>, <a href="mailto:charlie.chang@iisigroup.com" target="_blank">charlie.chang@iisigroup.com</a>, &quot;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&gt;<div><div class="h5"><br>主旨: Re: [ncl-talk] Where are the functions processing the string information in a CGM file?<br><br><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Gin Lin,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It&#39;s possible that these text strings were drawn with stroked fonts, and hence they won&#39;t show up as actual text strings in your CGM.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don&#39;t know how these strings were created, but if they were drawn using the &quot;medium&quot; or &quot;high&quot; quality fonts, then they will be stroked.  If they were drawn using &quot;low&quot; quality, then the characters will be output as strings in the metafile.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">From the images you sent me, they do not look like low quality fonts, so my guess is that they are stroked fonts, and hence you won&#39;t be able to search for the actual string in the metafile.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 24, 2015 at 3:15 AM,  <span dir="ltr">&lt;<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi, Mary.</div><div><br></div><div>Thanks for your reply.</div><div><br></div><div>I think you are right, the files are actually NCGM,</div><div><br></div><div>I found out there is a switch-case which looks like checking the input file is CGM or NCGM in our program.</div><div><br></div><div>Both of this two files are judged as NCGM.</div><div><br></div><div><br></div><div><br></div><div>I tried to use ctrans today, and I got the text files translated from the binary files.</div><div><br></div><div>The attachment is the header of the original file which can be viewed correctly in AWIPS and the new file which cannot.</div><div><br></div><div>I know they look like the same. I think the problem may not be the difference of their header.</div><div><br></div><div><br></div><div><br></div><div>I tried to search the strings such as &quot;JMA&quot;, &quot;CROSS&quot;, &quot;PRESSURE&quot; in the text file,</div><div><br></div><div>but they can&#39;t be found.</div><div><br></div><div>So I&#39;m still confused at how Idt and our AWIPS program show it on the picture.</div><div><br></div><div>Can you give me some advice?</div><div><br></div><div><br></div><div><br></div><div>Thank you.</div><div><br></div><div>Gin Lin.</div><div><br><br><font color="#990099">-----<a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a> 撰寫:-----</font></div><div style="padding-left:5px"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px">收件人: <a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a><br>寄件人: Mary Haley <u></u><br>傳送自: <a href="mailto:ncl-talk-bounces@ucar.edu" target="_blank">ncl-talk-bounces@ucar.edu</a><br>日期: 09/24/2015 10:40上午<br>副本抄送: &quot;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&gt;, <a href="mailto:charlie.chang@iisigroup.com" target="_blank">charlie.chang@iisigroup.com</a>, <a href="mailto:bobo.wang@iisigroup.com" target="_blank">bobo.wang@iisigroup.com</a><br>主旨: Re: [ncl-talk] Where are the functions processing the string information in a CGM file?<div><div><br><br><div dir="ltr"><div class="gmail_default" style="font-size:small">Gin Lin,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Idt is a very old program, and the original developer is not part of our team any more.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, I&#39;m wondering if part of your issue is that idt is for viewing NCGM files, and not CGM files. An NCGM file is NCAR&#39;s special CGM format. I would be surprised if other programs were actually able to view NCGM files.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Did you try using &quot;ncgm2cgm&quot; to convert the NCGM to a CGM file?  You can also look at the ncgm2cgm.c and cgm2ncgm.c programs to see the code that converts from one format to another.  This might help you find the source of the problem.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;ve attached the two codes here.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Finally, you may want to read our &quot;CGM, Graphicap, and Fontcap Supplement&quot; document, which contains a section on the &quot;NCAR Computer Graphics Metafile&quot;.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncarg.ucar.edu/supplements/cgm_supp/cgm_supp.html" target="_blank">http://www.ncarg.ucar.edu/supplements/cgm_supp/cgm_supp.html</a><br></div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 22, 2015 at 9:57 PM,  <span dir="ltr">&lt;<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>Dear all:</div><div><br></div><div>First let me introduce our situation.</div><div><br></div><div>I am one member in CWB in Taiwan, 20 years ago someone write a program for AWIPS,</div><div><br></div><div>so we can view the CGM file by using AWIPS.</div><div><br></div><div>Recently, the format of the CGM files we get is changed, and this program cannot show the string information in the new CGM files.</div><div><br></div><div>You can see the attachments, the color one is what it looks like in idt,</div><div><br></div><div>and the green one is what it looks like in AWIPS,</div><div><br></div><div>and the messages marked by read lines in the idt picture disappeared in the AWIPS picture.</div><div><br></div><div>We want to edit this program to fix it.</div><div><br></div><div><br></div><div><br></div><div>I checked our program for AWIPS, but I can&#39;t find where is the function which print out the string information.</div><div><br></div><div>I think it may not belong to the TEXT element of class 4.</div><div><br></div><div>The files we have are all binary, so I can&#39;t read them.</div><div><br></div><div>I also tried to read the source code of idt but I can&#39;t understand it. Forgive me.</div><div><br></div><div><br></div><div><br></div><div>So, my questions are:</div><div><br></div><div>1. Where are the functions processing this string information in a CGM file?</div><div><br></div><div>or more briefly, how idt print out this information on the picture?</div><div><br></div><div>2. Where are the strings in a CGM file?</div><div><br></div><div>Do they belong to the class 4 TEXT element?</div><div><br></div><div>Or they are actually another element?</div><div><br></div><div><br></div><div><br></div><div>Thank you.</div><div><br></div><div>Gin Lin</div><div></div></font><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<div><font face="Courier New,Courier,monospace" size="3">_______________________________________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></font></div><u></u></div></div></div><br><br>[附加檔案 &quot;cgm2ncgm.c&quot; 由 Gin Lin/iisigroup 移除]<br>[附加檔案 &quot;ncgm2cgm.c&quot; 由 Gin Lin/iisigroup 移除]</div><div></div></font></blockquote></div><br></div>
</div></div></div></div><div></div></font>
</blockquote></div><br></div>