1 #!/bin/sh 2 3 #### 4 #### Build an afm directory for the fonts supplied 5 #### with ghostscript 6 #### 7 8 #### 9 #### To make the result of this script work with the 'Ted' word 10 #### processor two X11 resources must be set to point to the correct 11 #### files in the ghostscript distribution. As an example I give the 12 #### values that last worked on my computer. For more information, see 13 #### the 'Ted' documentation. 14 #### 15 #### Use the 'gs -h' command to find the exact locations. 16 #### 17 #### Ted.ghostscriptFontmap: /usr/share/ghostscript/6.53/lib/Fontmap.GS 18 #### Ted.ghostscriptFontToXmapping: /usr/share/ghostscript/fonts/fonts.dir 19 #### 20 21 #### 22 #### Configurable Values 23 #### 24 25 GHOST_FONT_DIR=/usr/share/fonts/type1/gsfonts 26 TED_AFM_DIR=@DATADIR@/Ted/afm 27 28 set -u -e 29 30 #### 31 #### Does the target exist.. 32 #### If not make it. 33 #### 34 35 if test -d $TED_AFM_DIR 36 then 37 : ok 38 else 39 mkdir -p $TED_AFM_DIR 40 fi 41 42 #### 43 #### Change a GhostScript afm file to use the name of a similar 44 #### Adobe Base 35 font. 45 #### 46 47 urw_to_base35() 48 { 49 FAM_ALIAS="$1" 50 FAM_NAME="$2" 51 FONT_ALIAS="$3" 52 FONT_NAME="$4" 53 FULL_ALIAS="$5" 54 FULL_NAME="$6" 55 AFM_NAME="$7" 56 57 AFM_SOURCE=$GHOST_FONT_DIR/$AFM_NAME.afm 58 AFM_TARGET=$TED_AFM_DIR/$FONT_ALIAS.afm 59 60 ( 61 sed -e '2,$d' \ 62 $AFM_SOURCE 63 64 echo Comment Modified from $AFM_NAME.afm to simulate the Adobe base 35 65 echo Comment font \"$FULL_ALIAS\" with the similar URW++/GhostScript 66 echo Comment font \"$FULL_NAME\" in the \"Ted\" word processor. 67 68 sed -e 's/^FamilyName .*/'"FamilyName $FAM_ALIAS/" \ 69 -e 's/^FullName .*/'"FullName $FULL_ALIAS/" \ 70 -e 's/^FontName .*/'"FontName $FONT_ALIAS/" \ 71 -e '1d' \ 72 $AFM_SOURCE 73 74 ) > $AFM_TARGET 75 76 chmod 644 $AFM_TARGET 77 78 } 79 80 #### 81 #### Actual job 82 #### 83 84 #### 85 86 urw_to_base35 "ITC Avant Garde Gothic" \ 87 "URW Gothic L" \ 88 "AvantGarde-Book" \ 89 "URWGothicL-Book" \ 90 "ITC Avant Garde Gothic Book" \ 91 "URW Gothic L Book" \ 92 a010013l 93 94 urw_to_base35 "ITC Avant Garde Gothic" \ 95 "URW Gothic L" \ 96 "AvantGarde-BookOblique" \ 97 "URWGothicL-BookObli" \ 98 "ITC Avant Garde Gothic Book Oblique" \ 99 "URW Gothic L Book Oblique" \ 100 a010033l 101 102 urw_to_base35 "ITC Avant Garde Gothic" \ 103 "URW Gothic L" \ 104 "AvantGarde-Demi" \ 105 "URWGothicL-Demi" \ 106 "ITC Avant Garde Gothic Demi" \ 107 "URW Gothic L Demi" \ 108 a010015l 109 110 urw_to_base35 "ITC Avant Garde Gothic" \ 111 "URW Gothic L" \ 112 "AvantGarde-DemiOblique" \ 113 "URWGothicL-DemiObli" \ 114 "ITC Avant Garde Gothic Demi Oblique" \ 115 "URW Gothic L Demi Oblique" \ 116 a010035l 117 118 #### 119 120 urw_to_base35 "ITC Bookman" \ 121 "URW Bookman L" \ 122 "Bookman-Light" \ 123 "URWBookmanL-Ligh" \ 124 "ITC Bookman Light" \ 125 "URW Bookman L Light" \ 126 b018012l 127 128 urw_to_base35 "ITC Bookman" \ 129 "URW Bookman L" \ 130 "Bookman-LightItalic" \ 131 "URWBookmanL-LighItal" \ 132 "ITC Bookman Light Italic" \ 133 "URW Bookman L Light Italic" \ 134 b018032l 135 136 urw_to_base35 "ITC Bookman" \ 137 "URW Bookman L" \ 138 "Bookman-Demi" \ 139 "URWBookmanL-DemiBold" \ 140 "ITC Bookman Demi" \ 141 "URW Bookman L Demi Bold" \ 142 b018015l 143 144 urw_to_base35 "ITC Bookman" \ 145 "URW Bookman L" \ 146 "Bookman-DemiItalic" \ 147 "URWBookmanL-DemiBoldItal" \ 148 "ITC Bookman Demi Italic" \ 149 "URW Bookman L Demi Bold Italic" \ 150 b018035l 151 152 #### 153 154 urw_to_base35 "Courier" \ 155 "Nimbus Mono L" \ 156 "Courier" \ 157 "NimbusMonL-Regu" \ 158 "Courier" \ 159 "Nimbus Mono L Regular" \ 160 n022003l 161 162 urw_to_base35 "Courier" \ 163 "Nimbus Mono L" \ 164 "Courier-Oblique" \ 165 "NimbusMonL-ReguObli" \ 166 "Courier Oblique" \ 167 "Nimbus Mono L Regular Oblique" \ 168 n022023l 169 170 urw_to_base35 "Courier" \ 171 "Nimbus Mono L" \ 172 "Courier-Bold" \ 173 "NimbusMonL-Bold" \ 174 "Courier Bold" \ 175 "Nimbus Mono L Bold" \ 176 n022004l 177 178 urw_to_base35 "Courier" \ 179 "Nimbus Mono L" \ 180 "Courier-BoldOblique" \ 181 "NimbusMonL-BoldObli" \ 182 "Courier Bold Oblique" \ 183 "Nimbus Mono L Bold Oblique" \ 184 n022024l 185 186 #### 187 188 urw_to_base35 "Helvetica" \ 189 "Nimbus Sans L" \ 190 "Helvetica" \ 191 "NimbusSanL-Regu" \ 192 "Helvetica" \ 193 "Nimbus Sans L Regular" \ 194 n019003l 195 196 urw_to_base35 "Helvetica" \ 197 "Nimbus Sans L" \ 198 "Helvetica-Oblique" \ 199 "NimbusSanL-ReguItal" \ 200 "Helvetica Oblique" \ 201 "Nimbus Sans L Regular Italic" \ 202 n019023l 203 204 urw_to_base35 "Helvetica" \ 205 "Nimbus Sans L" \ 206 "Helvetica-Bold" \ 207 "NimbusSanL-Bold" \ 208 "Helvetica Bold" \ 209 "Nimbus Sans L Bold" \ 210 n019004l 211 212 urw_to_base35 "Helvetica" \ 213 "Nimbus Sans L" \ 214 "Helvetica-BoldOblique" \ 215 "NimbusSanL-BoldItal" \ 216 "Helvetica Bold Oblique" \ 217 "Nimbus Sans L Bold Italic" \ 218 n019024l 219 220 #### 221 222 urw_to_base35 "Helvetica" \ 223 "Nimbus Sans L" \ 224 "Helvetica-Narrow" \ 225 "NimbusSanL-ReguCond" \ 226 "Helvetica Narrow" \ 227 "Nimbus Sans L Regular Condensed" \ 228 n019043l 229 230 urw_to_base35 "Helvetica" \ 231 "Nimbus Sans L" \ 232 "Helvetica-Narrow-Oblique" \ 233 "NimbusSanL-ReguCondItal" \ 234 "Helvetica Narrow Oblique" \ 235 "Nimbus Sans L Regular Condensed Italic" \ 236 n019063l 237 238 urw_to_base35 "Helvetica" \ 239 "Nimbus Sans L" \ 240 "Helvetica-Narrow-Bold" \ 241 "NimbusSanL-BoldCond" \ 242 "Helvetica Narrow Bold" \ 243 "Nimbus Sans L Bold Condensed" \ 244 n019044l 245 246 urw_to_base35 "Helvetica" \ 247 "Nimbus Sans L" \ 248 "Helvetica-Narrow-BoldOblique" \ 249 "NimbusSanL-BoldCondItal" \ 250 "Helvetica Narrow Bold Oblique" \ 251 "Nimbus Sans L Bold Condensed Italic" \ 252 n019064l 253 254 #### 255 256 urw_to_base35 "New Century Schoolbook" \ 257 "Century Schoolbook L" \ 258 "NewCenturySchlbk-Roman" \ 259 "CenturySchL-Roma" \ 260 "New Century Schoolbook Roman" \ 261 "Century Schoolbook L Roman" \ 262 c059013l 263 264 urw_to_base35 "New Century Schoolbook" \ 265 "Century Schoolbook L" \ 266 "NewCenturySchlbk-Italic" \ 267 "CenturySchL-Ital" \ 268 "New Century Schoolbook Italic" \ 269 "Century Schoolbook L Italic" \ 270 c059033l 271 272 urw_to_base35 "New Century Schoolbook" \ 273 "Century Schoolbook L" \ 274 "NewCenturySchlbk-Bold" \ 275 "CenturySchL-Bold" \ 276 "New Century Schoolbook Bold" \ 277 "Century Schoolbook L Bold" \ 278 c059016l 279 280 urw_to_base35 "New Century Schoolbook" \ 281 "Century Schoolbook L" \ 282 "NewCenturySchlbk-BoldItalic" \ 283 "CenturySchL-BoldItal" \ 284 "New Century Schoolbook Bold Italic" \ 285 "Century Schoolbook L Bold Italic" \ 286 c059036l 287 288 #### 289 290 urw_to_base35 "Palatino" \ 291 "URW Palladio L" \ 292 "Palatino-Roman" \ 293 "URWPalladioL-Roma" \ 294 "Palatino Roman" \ 295 "URW Palladio L Roman" \ 296 p052003l 297 298 urw_to_base35 "Palatino" \ 299 "URW Palladio L" \ 300 "Palatino-Italic" \ 301 "URWPalladioL-Ital" \ 302 "Palatino Italic" \ 303 "URW Palladio L Italic" \ 304 p052023l 305 306 urw_to_base35 "Palatino" \ 307 "URW Palladio L" \ 308 "Palatino-Bold" \ 309 "URWPalladioL-Bold" \ 310 "Palatino Bold" \ 311 "URW Palladio L Bold" \ 312 p052004l 313 314 urw_to_base35 "Palatino" \ 315 "URW Palladio L" \ 316 "Palatino-BoldItalic" \ 317 "URWPalladioL-BoldItal" \ 318 "Palatino Bold Italic" \ 319 "URW Palladio L Bold Italic" \ 320 p052024l 321 322 #### 323 324 urw_to_base35 "Symbol" \ 325 "Standard Symbols L" \ 326 "Symbol" \ 327 "StandardSymL" \ 328 "Symbol" \ 329 "Standard Symbols L" \ 330 s050000l 331 332 #### 333 334 urw_to_base35 "Times" \ 335 "Nimbus Roman No9 L" \ 336 "Times-Roman" \ 337 "NimbusRomNo9L-Regu" \ 338 "Times Roman" \ 339 "Nimbus Roman No9 L Regular" \ 340 n021003l 341 342 urw_to_base35 "Times" \ 343 "Nimbus Roman No9 L" \ 344 "Times-Italic" \ 345 "NimbusRomNo9L-ReguItal" \ 346 "Times Italic" \ 347 "Nimbus Roman No9 L Regular Italic" \ 348 n021023l 349 350 urw_to_base35 "Times" \ 351 "Nimbus Roman No9 L" \ 352 "Times-Bold" \ 353 "NimbusRomNo9L-Medi" \ 354 "Times Bold" \ 355 "Nimbus Roman No9 L Medium" \ 356 n021004l 357 358 urw_to_base35 "Times" \ 359 "Nimbus Roman No9 L" \ 360 "Times-BoldItalic" \ 361 "NimbusRomNo9L-MediItal" \ 362 "Times Bold Italic" \ 363 "Nimbus Roman No9 L Medium Italic" \ 364 n021024l 365 366 #### 367 368 urw_to_base35 "ITC Zapf Chancery" \ 369 "URW Chancery L" \ 370 "ZapfChancery-MediumItalic" \ 371 "URWChanceryL-MediItal" \ 372 "ITC Zapf Chancery Medium Italic" \ 373 "URW Chancery L Medium Italic" \ 374 z003034l 375 376 #### 377 378 urw_to_base35 "ITC Zapf Dingbats" \ 379 "Dingbats" \ 380 "ZapfDingbats" \ 381 "Dingbats" \ 382 "ITC Zapf Dingbats" \ 383 "Dingbats" \ 384 d050000l 385 386 #### 387 388 exit 0