home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / apps / 8 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  12.7 KB

  1. Path: sparky!uunet!news.uiowa.edu!hobbes.physics.uiowa.edu!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!olivea!sgigate!sgi!fido!odin!news
  2. From: ib@ivan.asd.sgi.com (Ivan Bach)
  3. Newsgroups: comp.sys.sgi.apps
  4. Subject: Re: FrameMaker 3.1 Goes Crazy! (long)
  5. Keywords: FrameMaker, fonts, SGI, IBM
  6. Message-ID: <1992Dec30.193139.11790@odin.corp.sgi.com>
  7. Date: 30 Dec 92 19:31:39 GMT
  8. References: <1992Dec29.040152.18074@ringer.cs.utsa.edu>
  9. Sender: news@odin.corp.sgi.com (Net News)
  10. Organization: Silicon Graphics, Inc., Mountain View, CA
  11. Lines: 425
  12. Nntp-Posting-Host: ivan.asd.sgi.com
  13.  
  14. In article <1992Dec29.040152.18074@ringer.cs.utsa.edu>, 
  15. senseman@lucy.brainlab.utsa.edu (David M. Senseman) writes:
  16. > Everytime I open a document on my Indigo that was previously created
  17. > on the IBM I get a warning about "unavailable fonts"
  18. You should determine which fonts are available to FrameMaker (FM) on your
  19. IBM computer, which fonts are available to FM on your SGI computer, and
  20. which fonts are used in the document you prepared on your IBM computer.
  21.  
  22. To find out which fonts are available to FM, select the option 'Character' in
  23. the 'Format' menu.  When the 'Character Format' window is displayed, look for
  24. a list called the 'Font Family' list.  You can scroll through that list to see
  25. which fonts are available in your FrameMaker installation.
  26.  
  27. Alternatively, enter the commands:
  28.  
  29.     cd install_dir/.fminit2.0.ps/fontdir
  30.     ls
  31.  
  32. on your SGI machine.  The default name for the install directory is /usr/frame.
  33. That should give you a list of installed fonts.  FrameMaker uses the file
  34. fontlist in that directory.  Take a look at that file.
  35.  
  36. I'll append a script that can be used to find out which fonts are used
  37. in an FM document stored in the MIF format.  You should determine which
  38. fonts are installed on both machines, and then use only those fonts, or
  39. install on your SGI machine the fonts you are missing.  As it says in
  40. Appendix F of the SGI FrameMaker Reference manual, you can order additional
  41. technical documents about the adding of PostScript fonts to FM from SGI.  
  42. I have added Macintosh PS fonts to FM on an SGI machine.
  43.  
  44. Technical writers from Intuit reported:
  45. --------------------------------------------------------------------------
  46. The situation seems to be that if a font exists on both the Mac and a Unix
  47. machine, FrameMaker recognizes that font. Otherwise, it reformats the 
  48. unknown font as Times or makes a "best guess." For example, the Unix FM 
  49. reformats Helvetica Condensed as Helvetica Narrow.
  50. --------------------------------------------------------------------------
  51.  
  52. I have been reading articles in the newsgroup comp.text.frame, and I don't
  53. remember anybody reporting a similar problem.  I think that you should post
  54. an article in that newsgroup, and send a bug report to comments@frame.com.
  55. You should tell them which versions of FM you have on your computers, and
  56. give them a sample file prepared on your IBM machine.
  57.  
  58. Here is a script for finding font names in a MIF file:
  59. --------------------------------------------------------------------------
  60. From: bae@col.hp.com (Bruce Erickson)
  61. Date: Fri, 28 Aug 92 21:44:16 CDT
  62. Newsgroups: comp.text.frame
  63. Subject: List information about paragraphs
  64. Message-Id: <1992Aug28.195011.7007@col.hp.com>
  65. X-Orig-Date: 28 Aug 92 20:44:20 GMT
  66. Organization: Hewlett-Packard Logic Systems Operation
  67.  
  68. A while ago I posted a note asking if there was a quick way to get
  69. a table of information about paragraphs -- font names, point sizes,
  70. etc.  All responses were of the form "convert to MIF and write an
  71. [awk, sed, ....] script".  Many added "...and when you have done that,
  72. let me know!"
  73.  
  74. Well, here it is.  It only scans for paragraph formats, not for any
  75. changes to the default paragraph formats actually in the text.
  76.  
  77. Not clean code, but gives output like this:
  78.  
  79.           font       var      weight   angle    size     lead    nexttag   
  80. al0_in0   Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in1  
  81. al0_in1   Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  al0_in1   
  82. bl_in0    Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in1  
  83. bl_in1    Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in2  
  84. Body      Times      Regular  Regular  Regular  9.0_pt   2.0_pt  none      
  85. body_in0  Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in   
  86. body_in1  Helvetica  Regular  Regular  Regular  10.0_pt  0.0_pt  body_in1  
  87. body_in2  Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in2  
  88. body_in3  Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in3  
  89. Comment   Times      Regular  Regular  Regular  9.0_pt   2.0_pt  none      
  90. Figure    Times      Regular  Regular  Regular  12.0_pt  2.0_pt  none      
  91. h1        Times      Regular  Bold     Regular  12.0_pt  2.0_pt  body_in0  
  92. h2        Times      Regular  Regular  Regular  12.0_pt  2.0_pt  body_in0  
  93. h3        Times      Regular  Regular  Regular  12.0_pt  2.0_pt  body_in0  
  94. h4        Times      Regular  Regular  Regular  12.0_pt  2.0_pt  body_in0  
  95. vl0_in0   Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in1  
  96. vl_in0    Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in1  
  97. vl_in1    Helvetica  Regular  Regular  Regular  10.0_pt  0.0_pt  body_in2  
  98. vl_in2    Helvetica  Regular  Regular  Regular  10.0_pt  2.0_pt  body_in3  
  99.  
  100. The code consists of three shell scripts (sorry non UNIX users!):
  101.     -parasumm, the outer script
  102.     -awkgen, which is a generic script I use to create awk scripts....
  103.     -awkrep, another generic script I use to convert labled data to tables..
  104.  
  105.                   - Bruce Erickson
  106.                      Hewlett Packard
  107.                      bae@col.hp.com
  108.  
  109.  
  110. # This is a shell archive.  Remove anything before this line,
  111. # then unpack it by saving it in a file and typing "sh file".
  112. #
  113. # Wrapped by Bruce Erickson <bae@hplsdrn> on Fri Aug 28 13:47:04 1992
  114. #
  115. # This archive contains:
  116. #    parasumm    awkgen        awkrep        
  117. #
  118.  
  119. LANG=""; export LANG
  120. PATH=/bin:/usr/bin:$PATH; export PATH
  121.  
  122. echo x - parasumm
  123. cat >parasumm <<'@EOF'
  124. #!/bin/ksh
  125. #    ex:se ts=3 sw=3:
  126. usage="usage: parasumm <MIF file>"
  127. #
  128. #
  129.  
  130. FMDIR=/site/frame/bin
  131. #    Set up the PATH variable
  132. PATH=/bin:/usr/bin:$FMDIR:.
  133. SHELL=/bin/ksh
  134.  
  135.  
  136. set -- `getopt "" "$@"`
  137. if [ $? -ne 0 ]
  138. then
  139.     echo "$usage" >&2
  140.     exit 1
  141. fi
  142.  
  143. while [ $# -gt 0 ]
  144. do
  145.     case $1 in
  146.         --)    shift; break;;
  147.         -*)    echo "$usage" >&2; exit 1;;
  148.     esac
  149. done
  150.  
  151. if [ $# -ne 1 ]
  152. then
  153.     echo "$usage" >&2
  154.     exit 1
  155. fi
  156.  
  157. framefile=$1
  158. tmpawk1=/usr/tmp/psawk_$$
  159. tmpawk2=/usr/tmp/psawk2_$$
  160.  
  161. trap "rm -f $tmpawk1 $tmpawk2; trap '' 0 1 2 3 4; exit" 0 1 2 3 4
  162.  
  163. if [ ${framefile%.mif} = $framefile ]
  164. then
  165.     miffile=${framefile#.*}.mif
  166.     # Must obtain .MIF file
  167.     fmbatch <<-EOF
  168.         Open $framefile
  169.         SaveAs mif $framefile $miffile
  170.         Quit
  171.     EOF
  172. else
  173.     # Passed in the .mif file -- a timesaver!
  174.     miffile=$framefile
  175. fi
  176.  
  177. #    Read in PgfCatalog; create info based on PgfTag
  178. #    When we get to a Paragraph which uses PgfTag xx, look for
  179. #    overrides of font (etc).
  180.  
  181. # remember: any $, ', or ` to be passed in must be escaped so the shell doesn't intrepret it!
  182. awkgen > $tmpawk1 <<-EOF
  183.     <PgfTag
  184.     tag
  185.                 /<PgfTag/ { s=index(\$0, "\`")+1; l=length(\$0)-s-1; tag = substr(\$0, s, l) }
  186.     font
  187.                 /<FFamily/ { s=index(\$0, "\`")+1; l=length(\$0)-s-1; font = substr(\$0, s, l) } 
  188.     var
  189.                 /<FVar/ { s=index(\$0, "\`")+1; l=length(\$0)-s-1; var = substr(\$0, s, l) }
  190.     weight
  191.                 /<FWeight/ { s=index(\$0, "\`")+1; l=length(\$0)-s-1; weight = substr(\$0, s, l) }
  192.     angle
  193.                 /<FAngle/ { s=index(\$0, "\`")+1; l=length(\$0)-s-1; angle = substr(\$0, s, l) }
  194.     size
  195.                 /<FSize/ { t = \$2 "_" \$3; size = substr(t, 1, length(t) - 1)}
  196.     lead
  197.                 /<PgfLeading/ { t = \$2 "_" \$3; lead = substr(t, 1, length(t) - 1)}
  198.     InSeRt    
  199.                 /<PgfUseNextTag/    { if (\$2 == "Yes") { nexttag = 1 } else { nexttag = 0 }}
  200.     nexttag
  201.                 /<PgfNextTag/ { if (nexttag) {s=index(\$0, "\`")+1; l=length(\$0)-s-1; nexttag = substr(\$0, s, l)} else { nexttag = "none" }}
  202. EOF
  203.     #cat $tmpawk1
  204.  
  205. sed -e '1,/^<PgfCatalog/ d' -e '/^>/,$ d' < $miffile |
  206.     awk -f $tmpawk1 > $tmpawk2
  207.  
  208. awkrep $tmpawk2
  209. @EOF
  210.  
  211. chmod 775 parasumm
  212.  
  213. echo x - awkgen
  214. cat >awkgen <<'@EOF'
  215. #!/bin/ksh
  216. #    ex:se ts=3 sw=3:
  217. usage="usage: "
  218. #
  219. #    Generate an awk file which will:
  220. #        create a file which is of the form 'aentry' 'elname' 'elvalue' ['elname' 'elvalue' ....]
  221. #    this essentially can be used to create a series of arrays:
  222. #        elname1[aentry] = elvalue1; elname2[aentry] = elvalue2.... or
  223. #        array[aentry, elname1] = elvalue1; array[aentry, elname2] = elvalue2, .....
  224. #
  225. #    This reads stdin to create the awk file:
  226. #        line  1 defines a pattern which is the start of 'aentry'.
  227. #        line 2,3 defines a pattern and an action to define 'aentry' -- it must occur prior to any elements
  228. #                aentryname '/<pattern>/ { aentryname = value }
  229. #    
  230. #    The rest of the lines define patterns and actions which define 'elname' and 'elvalue' as:
  231. #            'elname /<pattern>/ { elname = value }'
  232. #
  233. #        if $1 is 'InSeRt', then the rest of the line s a string which will be inserted into the awk
  234. #        script prior to any automatically generated statements.
  235.  
  236. #    This emits the awk file to stdout...
  237.  
  238. #    Set up the PATH variable
  239. PATH=/bin:/usr/bin:
  240. SHELL=/bin/ksh
  241.  
  242. # Cannot call getopt!
  243.  
  244. if [ $# -ne 0 ]
  245. then
  246.     echo "$usage" >&2
  247.     exit 1
  248. fi
  249.  
  250.     awk    '    
  251.                 NR == 1    {    startptn = $0 ; next }
  252.                 NR == 2    {    aentryname = $0; next }
  253.                 NR == 3    {    aentryawk = $0; next 
  254.                                 printf "BEGIN  {  %s = \"\"; }\n", aentryname
  255.                             }
  256.  
  257.                 /InSeRt/    {    getline
  258.                                 print $0; next
  259.                             }
  260.  
  261.                             {    numparts++
  262.                                 partname[numparts] = $0
  263.                                 getline
  264.                                 partawk[numparts] = $0
  265.                                 #printf "partname = @%s@, awk = @%s@\n", partname[numparts], partawk[numparts]
  266.                             }
  267.  
  268.                 END        {    
  269.                                 
  270.                                 # Found start pattern -- emit previous information if any
  271.                                 printf "/%s/    { if (%s !~ /^$/)\n", startptn, aentryname
  272.                                 printf "        {\n"
  273.                                 printf "            printf \"%%s \", %s\n", aentryname
  274.                                 for (p = 1; p <= numparts; p++)
  275.                                 {
  276.                                     printf "            printf \"%s %%s \", %s\n", partname[p], partname[p]
  277.                                 }
  278.                                 printf "            printf \"\\n\"\n        }\n"
  279.  
  280.                                 printf "    }\n"
  281.  
  282.                                 printf "%s\n", aentryawk
  283.  
  284.                                 for (p = 1; p <= numparts; p++)
  285.                                 {
  286.                                     printf "%s\n", partawk[p]
  287.                                 }
  288.  
  289.                                 printf "\n"
  290.                                 printf "END    {\n"
  291.                                 printf "    { if (%s !~ /^$/)\n", aentryname
  292.                                 printf "        {\n"
  293.                                 printf "            printf \"%%s \", %s\n", aentryname
  294.                                 for (p = 1; p <= numparts; p++)
  295.                                 {
  296.                                     printf "            printf \"%s %%s \", %s\n", partname[p], partname[p]
  297.                                 }
  298.                                 printf "            printf \"\\n\"\n        }\n"
  299.                                 printf "    }\n}"
  300.  
  301.                             }
  302.             '
  303. exit
  304. @EOF
  305.  
  306. chmod 775 awkgen
  307.  
  308. echo x - awkrep
  309. cat >awkrep <<'@EOF'
  310. #!/bin/ksh
  311. #    ex:se ts=3 sw=3:
  312. usage="usage: awkrep <file>"
  313. #
  314. #    <file> is of the form:
  315. #    <tag> <label1> <value1> [<label2> <value2> ..]
  316. #    Converts to a table of output...
  317. #    
  318. #
  319.  
  320. #    Set up the PATH variable
  321. PATH=/bin:/usr/bin:
  322. SHELL=/bin/ksh
  323.  
  324. set -- `getopt "" "$@"`
  325. if [ $? -ne 0 ]
  326. then
  327.     echo "$usage" >&2
  328.     exit 1
  329. fi
  330.  
  331. while [ $# -gt 0 ]
  332. do
  333.     case $1 in
  334.         --)    shift; break;;
  335.         -*)    echo "$usage" >&2; exit 1;;
  336.     esac
  337. done
  338.  
  339. if [ $# -ne 1 ]
  340. then
  341.     echo "$usage" >&2
  342.     exit 1
  343. fi
  344.  
  345. infile=$1
  346.  
  347. (
  348.     #    Pass 1: get list of all labels and their max width...
  349.     #    This emits a line which is of the form:
  350.     #    <label> <width> [<label> <width> ....
  351.     awk '    BEGIN    {    numlabels = 1 }
  352.  
  353.             {    for (label = 2; label <= NF; label = label + 2)
  354.                 {
  355.                     if (labels[$label] == "" )
  356.                     {
  357.                         labels[$label] = $label
  358.                         # New label!
  359.                         labellist[numlabels] = $label
  360.                         # printf "label %s is %d\n", $label, numlabels
  361.                         numlabels++
  362.                         width = length($label)
  363.                         widths[$label] = width
  364.                     }
  365.                     
  366.                     value = label + 1
  367.                     width = length($value)
  368.                     if (widths[$label] < width)
  369.                         widths[$label] = width
  370.                 }
  371.  
  372.                 if (length($1) > tagwidth)
  373.                     tagwidth = length($1)
  374.             }
  375.  
  376.         END    {    printf "%d ", tagwidth
  377.                     for (l = 1; l < numlabels; l++)
  378.                     {
  379.                         printf "%s %d ", labellist[l], widths[labellist[l]]
  380.                     }
  381.                     printf "\n"
  382.  
  383.                 }' < $infile
  384.     cat $infile
  385. ) |
  386.     awk '
  387.         NR == 1    {    # list of labels & widths, in order
  388.                         tagwidth = $1
  389.                         numlabels = 0
  390.                         for (l = 2; l <= NF; l = l + 2)
  391.                         {
  392.                             numlabels = numlabels + 1
  393.                             label2order[$l] = numlabels
  394.                             labellist[numlabels] = $l
  395.                             m = l + 1
  396.                             width[numlabels] = $m
  397.                         }
  398.  
  399.                         # Print heading
  400.                         printf "%-*s  ", tagwidth, ""
  401.                         for (l = 1; l <= numlabels; l++)
  402.                         {
  403.                             printf "%-*s  ", width[l], labellist[l]
  404.                         }
  405.                         printf "\n"
  406.                         next
  407.                     }
  408.  
  409.                     {    # Input line!  
  410.                         leader = $1
  411.  
  412.                         for (a = 1; a <= numlabels; a++)
  413.                             args[a] = ""
  414.                         
  415.                         for (b = 2; b <= NF; b++)
  416.                         {
  417.                             valn = b + 1
  418.                             value = $valn
  419.                             lnum = label2order[$b]    # Which label?
  420.                             args[lnum] = value
  421.                         }
  422.  
  423.                         # Print out line
  424.                         printf "%-*s  ", tagwidth, $1
  425.                         for (l = 1; l <= numlabels; l++)
  426.                         {
  427.                             printf "%-*s  ", width[l], args[l]
  428.                         }
  429.                         printf "\n"
  430.                     }'
  431.  
  432. @EOF
  433.  
  434. chmod 775 awkrep
  435.  
  436. exit 0
  437.  
  438. Ivan Bach, ib@sgi.com
  439.