<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 "Stroked font" is of much better quality than the string "Non-stroked font". That'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 > 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 -> 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) -> 11649, 26570</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span> P(1) -> 11649, 26601</font></div><div class="gmail_default" style=""><font face="monospace, monospace"><span class="" style="white-space:pre">                </span>P(2) -> 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 -> 5851, 19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -> final</font></div><div style=""><font face="monospace, monospace"> string -> "N"</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 -> 7255, 19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -> final</font></div><div style=""><font face="monospace, monospace"> string -> "o"</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 -> 8659, 19660</font></div><div style=""><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>final/not final -> final</font></div><div style=""><font face="monospace, monospace"> string -> "n"</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 -> 10064, 19660</font></div><div style=""><font face="monospace, monospace"> final/not final -> final</font></div><div style=""><font face="monospace, monospace"> string -> "-"</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 -> 11468, 19660</font></div><div style=""><font face="monospace, monospace"> final/not final -> final</font></div><div style=""><font face="monospace, monospace"> string -> "s"</font></div><div style="font-size:small"><br></div><div style="font-size:small">If you look at the "string" word, you will see that this is the start of the "Non-stroked font" string.</div><div style="font-size:small"><br></div><div style="font-size:small">So, I'm sorry to say that there'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"><<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>></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't know where they are,</div><div><br></div><div>I can'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: "ctrans -d CTXT (binary file name) > (output text)"</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 <<a href="mailto:haley@ucar.edu" target="_blank">haley@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 <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>><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>, "<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><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's possible that these text strings were drawn with stroked fonts, and hence they won'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't know how these strings were created, but if they were drawn using the "medium" or "high" quality fonts, then they will be stroked. If they were drawn using "low" 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'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"><<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>></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 "JMA", "CROSS", "PRESSURE" in the text file,</div><div><br></div><div>but they can't be found.</div><div><br></div><div>So I'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>副本抄送: "<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>" <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>>, <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'm wondering if part of your issue is that idt is for viewing NCGM files, and not CGM files. An NCGM file is NCAR'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 "ncgm2cgm" 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'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 "CGM, Graphicap, and Fontcap Supplement" document, which contains a section on the "NCAR Computer Graphics Metafile".</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"><<a href="mailto:Gin.Lin@iisigroup.com" target="_blank">Gin.Lin@iisigroup.com</a>></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'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't read them.</div><div><br></div><div>I also tried to read the source code of idt but I can'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>[附加檔案 "cgm2ncgm.c" 由 Gin Lin/iisigroup 移除]<br>[附加檔案 "ncgm2cgm.c" 由 Gin Lin/iisigroup 移除]</div><div></div></font></blockquote></div><br></div>
</div></div></div></div><div></div></font>
</blockquote></div><br></div>