home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume18 / X11R5-fix13 / part01 next >
Encoding:
Internet Message Format  |  1992-07-22  |  52.7 KB

  1. Path: uunet!dtix!darwin.sura.net!mips!msi!dcmartin
  2. From: gildea@EXPO.LCS.MIT.EDU (Stephen Gildea)
  3. Newsgroups: comp.sources.x
  4. Subject: v18i042: X11R5 public fix #13, Part01/05
  5. Message-ID: <csx-18i042-X11R5-fix13@uunet.UU.NET>
  6. Date: 22 Jul 92 15:05:45 GMT
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. Lines: 1716
  10. Approved: dcmartin@msi.com
  11. Originator: dcmartin@fascet
  12.  
  13. Submitted-by: gildea@EXPO.LCS.MIT.EDU (Stephen Gildea)
  14. Posting-number: Volume 18, Issue 42
  15. Archive-name: X11R5-fix13/part01
  16.  
  17. Fix 13 corrects some serious Font Service protocol errors in both the
  18. font server and font client libraries.  Because these fixes change the
  19. implemented protocol in an incompatible way, the version number is
  20. changed to 2.0.  The old, broken implementation is still supported as
  21. version 1; new clients can talk to old font servers, and vice versa.
  22.  
  23. These protocol fixes and other bug fixes are detailed below:
  24.  
  25. FS protocol: fontserver and fontlib have fsChar2B backwards
  26. FS protocol: ListFontsWithXInfo reply incorrectly formatted
  27. FS protocol: fs returns font metrics rather than ink metrics for some fonts
  28. FS protocol: ListFontsWithXInfo reply length incorrect
  29. FS protocol: ListFontsWithXInfo last reply length incorrect
  30. FS protocol: fs can return -1 authorization index
  31. FS protocol: auth_len is miscalculated in initial connection
  32. config: bdftopcf and mkfontdir not made if BuildFonts is NO
  33. fontlib: fs crashes if filename suggests scalable but XLFD name does not
  34. fontlib: bdf file with empty XLFD field crashes fs
  35. fontlib: bdf reader doesn't check for end of file
  36. fontlib: pcf reader frees uninitialized pointer on error
  37. fontlib: "byte" used as a variable name
  38. fontlib: fs_send_load_bitmap uses QueryXBitamp8 with 16-bit encoded character
  39. fontlib: attempt to access fonts through chained font servers fails
  40. fontlib: Speedo reader frees uninitialized pointer on error
  41. fontlib: Speedo generation fails at tiny sizes
  42. fontlib: ListFontsWithXInfo reply incorrectly parsed
  43. fontlib: libFS tries to read extension data twice
  44. fontlib: X server can't detect when font server has died
  45. fontlib: memory leaks
  46. fontserver: fs dies if garbage characters fed to its socket
  47. fontserver: fs doesn't manage signals correctly
  48. fontserver: syntax errors in osdep.h
  49. fontserver: fs dispatch routines poorly named
  50. fontserver: parameters swapped on call to WriteSwappedDataToClient
  51. fontserver: some error states return the same value as FSSuccess
  52. fontserver: fs can dereference a bogus pointer when reseting
  53. fontserver: ListFonts can attempt to free nonexistent memory
  54. fontserver: fs can dump core when chaining fontservers
  55. fontserver: when no font path elements, ListFonts sends no reply
  56. fontserver: num_range not byte-swapped for QueryXExtents and QueryXBitmaps
  57. fontserver: QueryExtension request doesn't get byte swapped
  58. fontserver: memory leaks
  59. FS protocol document: changed to read version 2.0
  60. showfont: handles nonexistent characters incorrectly
  61. showfont: incorrectly generates 2-byte ranges
  62. showfont: bitmap format is not always passed to the font server correctly
  63. misc fonts: some Scandinavian characters wrong or poorly-formed
  64.  
  65. #!/bin/sh
  66. # This is a shell archive (produced by shar 3.50)
  67. # To extract the files from this archive, save it to a file, remove
  68. # everything above the "!/bin/sh" line above, and type "sh file_name".
  69. #
  70. # made 07/22/1992 15:01 UTC by dcmartin@fascet
  71. # Source directory /n/merlin/u2/src/X11R5/fixes
  72. #
  73. # existing files will NOT be overwritten unless -c is specified
  74. #
  75. # This is part 1 of a multipart archive                                    
  76. # do not concatenate these parts, unpack them in order with /bin/sh        
  77. #
  78. # This shar contains:
  79. # length  mode       name
  80. # ------ ---------- ------------------------------------------
  81. # 229952 -rw-r--r-- fix-13
  82. #
  83. if test -r _shar_seq_.tmp; then
  84.     echo 'Must unpack archives in sequence!'
  85.     echo Please unpack part `cat _shar_seq_.tmp` next
  86.     exit 1
  87. fi
  88. # ============= fix-13 ==============
  89. if test -f 'fix-13' -a X"$1" != X"-c"; then
  90.     echo 'x - skipping fix-13 (File already exists)'
  91.     rm -f _shar_wnt_.tmp
  92. else
  93. > _shar_wnt_.tmp
  94. echo 'x - extracting fix-13 (Text)'
  95. sed 's/^X//' << 'SHAR_EOF' > 'fix-13' &&
  96. X              Release 5 Public Patch #13
  97. X               MIT X Consortium
  98. X
  99. To apply this patch:
  100. X
  101. cd to the top of the source tree (to the directory containing the "mit"
  102. and "contrib" subdirectories) and do:
  103. X    patch -p -s < ThisFile
  104. Patch will work silently unless an error occurs.  You will likely get
  105. the following warning messages, which can be ignored:
  106. X    mkdir: mit: File exists
  107. X    mkdir: mit/fonts: File exists
  108. X    mkdir: mit/fonts/server: File exists
  109. X    mkdir: mit/fonts/server/difs: File exists
  110. If you want to watch patch do its thing, leave out the "-s" argument to patch.
  111. X
  112. This patch creates one new file, mit/fonts/server/difs/charinfo.c.
  113. If you are using a symbolic link tree, you will need to create a new link.
  114. X
  115. Next, from the same top-level directory do:
  116. X    rm -f mit/fonts/lib/font/util/fsfuncs.[co]
  117. X    rm -f mit/fonts/lib/font/bitmap/fsfuncs.[co]
  118. (If you are using a symbolic tree, the .o files should be deleted there.)
  119. X
  120. Finally, to rebuild after applying this patch, cd to the "mit" subdirectory
  121. and do:
  122. X    make Everything >& every.log
  123. Note: this will *not* "clean" your tree.
  124. X
  125. X
  126. Brief notes on what this patch fixes:
  127. X
  128. This patch fixes some serious Font Service protocol errors in both the
  129. font server and font client libraries.  Because these fixes change the
  130. implemented protocol in an incompatible way, the version number is
  131. changed to 2.0.  The old, broken implementation is still supported as
  132. version 1; new clients can talk to old font servers, and vice versa.
  133. X
  134. These protocol fixes and other bug fixes are detailed below:
  135. X
  136. FS protocol: fontserver and fontlib have fsChar2B backwards
  137. FS protocol: ListFontsWithXInfo reply incorrectly formatted
  138. FS protocol: fs returns font metrics rather than ink metrics for some fonts
  139. FS protocol: ListFontsWithXInfo reply length incorrect
  140. FS protocol: ListFontsWithXInfo last reply length incorrect
  141. FS protocol: fs can return -1 authorization index
  142. FS protocol: auth_len is miscalculated in initial connection
  143. config: bdftopcf and mkfontdir not made if BuildFonts is NO
  144. fontlib: fs crashes if filename suggests scalable but XLFD name does not
  145. fontlib: bdf file with empty XLFD field crashes fs
  146. fontlib: bdf reader doesn't check for end of file
  147. fontlib: pcf reader frees uninitialized pointer on error
  148. fontlib: "byte" used as a variable name
  149. fontlib: fs_send_load_bitmap uses QueryXBitamp8 with 16-bit encoded character
  150. fontlib: attempt to access fonts through chained font servers fails
  151. fontlib: Speedo reader frees uninitialized pointer on error
  152. fontlib: Speedo generation fails at tiny sizes
  153. fontlib: ListFontsWithXInfo reply incorrectly parsed
  154. fontlib: libFS tries to read extension data twice
  155. fontlib: X server can't detect when font server has died
  156. fontlib: memory leaks
  157. fontserver: fs dies if garbage characters fed to its socket
  158. fontserver: fs doesn't manage signals correctly
  159. fontserver: syntax errors in osdep.h
  160. fontserver: fs dispatch routines poorly named
  161. fontserver: parameters swapped on call to WriteSwappedDataToClient
  162. fontserver: some error states return the same value as FSSuccess
  163. fontserver: fs can dereference a bogus pointer when reseting
  164. fontserver: ListFonts can attempt to free nonexistent memory
  165. fontserver: fs can dump core when chaining fontservers
  166. fontserver: when no font path elements, ListFonts sends no reply
  167. fontserver: num_range not byte-swapped for QueryXExtents and QueryXBitmaps
  168. fontserver: QueryExtension request doesn't get byte swapped
  169. fontserver: memory leaks
  170. FS protocol document: changed to read version 2.0
  171. showfont: handles nonexistent characters incorrectly
  172. showfont: incorrectly generates 2-byte ranges
  173. showfont: bitmap format is not always passed to the font server correctly
  174. misc fonts: some Scandinavian characters wrong or poorly-formed
  175. X
  176. X
  177. Prereq: public-patch-12
  178. X
  179. *** /tmp/da09678    Mon Jul 20 14:05:24 1992
  180. --- mit/bug-report    Mon Jul 20 14:05:24 1992
  181. ***************
  182. *** 2,8 ****
  183. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  184. X  
  185. X  VERSION:
  186. !     R5, public-patch-12
  187. X      [MIT public patches will edit this line to indicate the patch level]
  188. X  
  189. X  CLIENT MACHINE and OPERATING SYSTEM:
  190. --- 2,8 ----
  191. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  192. X  
  193. X  VERSION:
  194. !     R5, public-patch-13
  195. X      [MIT public patches will edit this line to indicate the patch level]
  196. X  
  197. X  CLIENT MACHINE and OPERATING SYSTEM:
  198. *** /tmp/da28082    Tue Jul 14 18:07:11 1992
  199. --- mit/fonts/include/FS.h    Tue Jul 14 18:07:10 1992
  200. ***************
  201. *** 1,4 ****
  202. ! /* $XConsortium: FS.h,v 1.4 91/05/13 16:45:26 gildea Exp $ */
  203. X  /* 
  204. X   * Copyright 1990, 1991 Network Computing Devices; 
  205. X   * Portions Copyright 1987 by Digital Equipment Corporation and the 
  206. --- 1,4 ----
  207. ! /* $XConsortium: FS.h,v 1.5 92/05/12 18:07:12 gildea Exp $ */
  208. X  /* 
  209. X   * Copyright 1990, 1991 Network Computing Devices; 
  210. X   * Portions Copyright 1987 by Digital Equipment Corporation and the 
  211. ***************
  212. *** 20,28 ****
  213. X   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  214. X   * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  215. X   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  216. -  *
  217. -  * @(#)FS.h    3.2    91/04/11
  218. -  *
  219. X   */
  220. X  #ifndef _FS_H_
  221. X  #define    _FS_H_
  222. --- 20,25 ----
  223. ***************
  224. *** 29,35 ****
  225. X  
  226. X  #include <fsmasks.h>
  227. X  
  228. ! #define    FS_PROTOCOL        1
  229. X  #define    FS_PROTOCOL_MINOR    0
  230. X  
  231. X  typedef unsigned long FSID;
  232. --- 26,32 ----
  233. X  
  234. X  #include <fsmasks.h>
  235. X  
  236. ! #define    FS_PROTOCOL        2
  237. X  #define    FS_PROTOCOL_MINOR    0
  238. X  
  239. X  typedef unsigned long FSID;
  240. *** /tmp/da28104    Tue Jul 14 18:07:13 1992
  241. --- mit/fonts/include/FSproto.h    Tue Jul 14 18:07:12 1992
  242. ***************
  243. *** 1,4 ****
  244. ! /* $XConsortium: FSproto.h,v 1.5 91/07/26 21:00:24 keith Exp $ */
  245. X  /*
  246. X   * Copyright 1990, 1991 Network Computing Devices;
  247. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  248. --- 1,4 ----
  249. ! /* $XConsortium: FSproto.h,v 1.6 92/05/12 18:07:14 gildea Exp $ */
  250. X  /*
  251. X   * Copyright 1990, 1991 Network Computing Devices;
  252. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  253. ***************
  254. *** 20,28 ****
  255. X   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  256. X   * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  257. X   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  258. -  *
  259. -  * $NCDId: @(#)FSproto.h,v 4.3 1991/06/27 16:30:07 lemke Exp $
  260. -  *
  261. X   */
  262. X  
  263. X  #ifndef _FS_PROTO_H_
  264. --- 20,25 ----
  265. ***************
  266. *** 114,122 ****
  267. X  }           fsCharInfo;
  268. X  
  269. X  typedef struct {
  270. X      CARD8       low,
  271. X                  high;
  272. ! }           fsChar2b;
  273. X  
  274. X  typedef struct {
  275. X      fsChar2b    min_char,
  276. --- 111,124 ----
  277. X  }           fsCharInfo;
  278. X  
  279. X  typedef struct {
  280. +     CARD8       high;
  281. +     CARD8       low;
  282. + }           fsChar2b;
  283. + typedef struct {
  284. X      CARD8       low,
  285. X                  high;
  286. ! }           fsChar2b_version1;
  287. X  
  288. X  typedef struct {
  289. X      fsChar2b    min_char,
  290. *** /tmp/da28168    Tue Jul 14 18:07:18 1992
  291. --- mit/fonts/include/fontstruct.h    Tue Jul 14 18:07:18 1992
  292. ***************
  293. *** 1,4 ****
  294. ! /* $Header: fontstruct.h,v 1.10 91/07/22 15:37:41 keith Exp $ */
  295. X  /***********************************************************
  296. X  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  297. X  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  298. --- 1,4 ----
  299. ! /* $XConsortium: fontstruct.h,v 1.11 92/05/12 18:07:16 gildea Exp $ */
  300. X  /***********************************************************
  301. X  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  302. X  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  303. ***************
  304. *** 21,28 ****
  305. X  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  306. X  SOFTWARE.
  307. X  
  308. -     @(#)fontstruct.h    3.2    91/04/15
  309. X  ******************************************************************/
  310. X  
  311. X  #ifndef FONTSTR_H
  312. --- 21,26 ----
  313. ***************
  314. *** 115,124 ****
  315. X      fsBitmapFormat format;
  316. X      int         (*get_glyphs) ( /* font, count, chars, encoding, count, glyphs */ );
  317. X      int         (*get_metrics) ( /* font, count, chars, encoding, count, glyphs */ );
  318. -     int         (*get_bitmaps) (/* client, font, flags, ranges, nranges,
  319. -                     nextents, extents */ );
  320. -     int         (*get_extents) (/* client, font, format, flags, ranges,
  321. -                     nranges, nglyphs, offsets, glyphs */ );
  322. X      void        (*unload_font) ( /* font */ );
  323. X      FontPathElementPtr fpe;
  324. X      pointer     svrPrivate;
  325. --- 113,118 ----
  326. *** /tmp/da25571    Tue Jul 14 18:03:15 1992
  327. --- mit/fonts/lib/Imakefile    Tue Jul 14 18:03:15 1992
  328. ***************
  329. *** 1,12 ****
  330. ! XCOMM $XConsortium: Imakefile,v 1.2 91/07/17 16:05:47 gildea Exp $
  331. X  #define IHaveSubdirs
  332. X  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  333. X  
  334. ! #if BuildServer | BuildFontServer | BuildFonts
  335. ! SRVDIRS = font
  336. ! #endif
  337. ! SUBDIRS = $(SRVDIRS) fs
  338. X  
  339. X  MakeSubdirs($(SUBDIRS))
  340. X  DependSubdirs($(SUBDIRS))
  341. --- 1,8 ----
  342. ! XCOMM $XConsortium: Imakefile,v 1.3 91/12/23 11:05:24 rws Exp $
  343. X  #define IHaveSubdirs
  344. X  #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  345. X  
  346. ! SUBDIRS = font fs
  347. X  
  348. X  MakeSubdirs($(SUBDIRS))
  349. X  DependSubdirs($(SUBDIRS))
  350. *** /tmp/da25708    Tue Jul 14 18:03:29 1992
  351. --- mit/fonts/lib/font/fontfile/fontdir.c    Tue Jul 14 18:03:28 1992
  352. ***************
  353. *** 1,5 ****
  354. X  /*
  355. !  * $XConsortium: fontdir.c,v 1.6 91/12/11 19:46:47 eswu Exp $
  356. X   *
  357. X   * Copyright 1991 Massachusetts Institute of Technology
  358. X   *
  359. --- 1,5 ----
  360. X  /*
  361. !  * $XConsortium: fontdir.c,v 1.9 92/03/20 15:53:29 eswu Exp $
  362. X   *
  363. X   * Copyright 1991 Massachusetts Institute of Technology
  364. X   *
  365. ***************
  366. *** 138,144 ****
  367. X  
  368. X      /* can't add entries to a sorted table, pointers get broken! */
  369. X      if (table->sorted)
  370. !     abort ();
  371. X      if (table->used == table->size) {
  372. X      newsize = table->size + 100;
  373. X      entry = (FontEntryPtr) xrealloc(table->entries,
  374. --- 138,144 ----
  375. X  
  376. X      /* can't add entries to a sorted table, pointers get broken! */
  377. X      if (table->sorted)
  378. !     return (FontEntryPtr) 0;    /* "cannot" happen */
  379. X      if (table->used == table->size) {
  380. X      newsize = table->size + 100;
  381. X      entry = (FontEntryPtr) xrealloc(table->entries,
  382. ***************
  383. *** 425,430 ****
  384. --- 425,435 ----
  385. X                           &vals, FONT_XLFD_REPLACE_NONE)) ||
  386. X        vals.pixel != 0)
  387. X      {
  388. +       /* If the fontname says it is nonScalable, make sure that the
  389. +        * renderer supports OpenBitmap and GetInfoBitmap.
  390. +        */
  391. +       if (renderer->OpenBitmap && renderer->GetInfoBitmap)
  392. +       {
  393. X      entry.type = FONT_ENTRY_BITMAP;
  394. X      entry.u.bitmap.renderer = renderer;
  395. X      entry.u.bitmap.pFont = NullFont;
  396. ***************
  397. *** 435,440 ****
  398. --- 440,446 ----
  399. X          xfree (entry.u.bitmap.fileName);
  400. X          return FALSE;
  401. X      }
  402. +       }
  403. X      }
  404. X      /*
  405. X       * Parse out scalable fields from XLFD names - a scalable name
  406. ***************
  407. *** 442,447 ****
  408. --- 448,458 ----
  409. X       */
  410. X      if (isscale)
  411. X      {
  412. +       /* If the fontname says it is scalable, make sure that the
  413. +        * renderer supports OpenScalable and GetInfoScalable.
  414. +        */
  415. +       if (renderer->OpenScalable && renderer->GetInfoScalable)
  416. +       {
  417. X      if (vals.pixel != 0)
  418. X      {
  419. X          zeroVals.pixel = 0;
  420. ***************
  421. *** 524,529 ****
  422. --- 535,541 ----
  423. X      }
  424. X      if (vals.pixel != 0)
  425. X          FontFileAddScaledInstance (scalable, &vals, NullFont, bitmap->name.name);
  426. +       }
  427. X      }
  428. X      return TRUE;
  429. X  }
  430. *** /tmp/da25926    Tue Jul 14 18:03:49 1992
  431. --- mit/fonts/lib/font/bitmap/pcfwrite.c    Tue Jul 14 18:03:48 1992
  432. ***************
  433. *** 1,5 ****
  434. X  /*
  435. !  * $XConsortium: pcfwrite.c,v 1.2 91/05/10 15:58:16 keith Exp $
  436. X   *
  437. X   * Copyright 1990 Massachusetts Institute of Technology
  438. X   *
  439. --- 1,5 ----
  440. X  /*
  441. !  * $XConsortium: pcfwrite.c,v 1.3 92/03/26 17:37:17 gildea Exp $
  442. X   *
  443. X   * Copyright 1990 Massachusetts Institute of Technology
  444. X   *
  445. ***************
  446. *** 208,218 ****
  447. X  pcfNameForAtom(a)
  448. X      Atom        a;
  449. X  {
  450. !     char       *name;
  451. !     if (!(name = NameForAtom(a)))
  452. !     name = "";
  453. !     return name;
  454. X  }
  455. X  
  456. X  pcfWriteFont(pFont, file)
  457. --- 208,214 ----
  458. X  pcfNameForAtom(a)
  459. X      Atom        a;
  460. X  {
  461. !     return NameForAtom(a);
  462. X  }
  463. X  
  464. X  pcfWriteFont(pFont, file)
  465. *** /tmp/da25948    Tue Jul 14 18:03:51 1992
  466. --- mit/fonts/lib/font/bitmap/Imakefile    Tue Jul 14 18:03:51 1992
  467. ***************
  468. *** 1,4 ****
  469. ! XCOMM $XConsortium: Imakefile,v 1.5 91/07/22 22:20:44 rws Exp $
  470. X  #include <Server.tmpl>
  471. X  
  472. X          INCLUDES = -I$(FONTSRC)/include -I../include -I$(FONTSERVERSRC)/include
  473. --- 1,4 ----
  474. ! XCOMM $XConsortium: Imakefile,v 1.6 92/05/13 14:12:15 gildea Exp $
  475. X  #include <Server.tmpl>
  476. X  
  477. X          INCLUDES = -I$(FONTSRC)/include -I../include -I$(FONTSERVERSRC)/include
  478. ***************
  479. *** 7,17 ****
  480. X       FORMAT_DEFS = FontFormatDefines
  481. X  #endif
  482. X              SRCS = bdfread.c bdfutils.c bitmap.c bitmaputils.c bitscale.c \
  483. !            bitmapfuncs.c fsfuncs.c pcfread.c pcfwrite.c snfread.c \
  484. X             fontink.c
  485. X  
  486. X              OBJS = bdfread.o bdfutils.o bitmap.o bitmaputils.o bitscale.o \
  487. !            bitmapfuncs.o fsfuncs.o pcfread.o pcfwrite.o snfread.o \
  488. X             fontink.o
  489. X  
  490. X  SubdirLibraryRule($(OBJS))
  491. --- 7,17 ----
  492. X       FORMAT_DEFS = FontFormatDefines
  493. X  #endif
  494. X              SRCS = bdfread.c bdfutils.c bitmap.c bitmaputils.c bitscale.c \
  495. !            bitmapfuncs.c pcfread.c pcfwrite.c snfread.c \
  496. X             fontink.c
  497. X  
  498. X              OBJS = bdfread.o bdfutils.o bitmap.o bitmaputils.o bitscale.o \
  499. !            bitmapfuncs.o pcfread.o pcfwrite.o snfread.o \
  500. X             fontink.o
  501. X  
  502. X  SubdirLibraryRule($(OBJS))
  503. *** /tmp/da25991    Tue Jul 14 18:03:56 1992
  504. --- mit/fonts/lib/font/bitmap/bdfread.c    Tue Jul 14 18:03:54 1992
  505. ***************
  506. *** 22,28 ****
  507. X  
  508. X  ************************************************************************/
  509. X  
  510. ! /* $XConsortium: bdfread.c,v 1.8 91/07/22 22:58:44 keith Exp $ */
  511. X  
  512. X  #include <ctype.h>
  513. X  #include "fontfilest.h"
  514. --- 22,28 ----
  515. X  
  516. X  ************************************************************************/
  517. X  
  518. ! /* $XConsortium: bdfread.c,v 1.13 92/05/12 18:07:40 gildea Exp $ */
  519. X  
  520. X  #include <ctype.h>
  521. X  #include "fontfilest.h"
  522. ***************
  523. *** 32,37 ****
  524. --- 32,38 ----
  525. X  
  526. X  #define INDICES 256
  527. X  #define MAXENCODING 0xFFFF
  528. + #define BDFLINELEN  1024
  529. X  
  530. X  extern int  bitmapGetGlyphs(), bitmapGetMetrics();
  531. X  extern int  bitmapGetBitmaps(), bitmapGetExtents();
  532. ***************
  533. *** 62,68 ****
  534. X      unsigned char *pInBits,
  535. X                 *picture,
  536. X                 *line = NULL;
  537. !     char        lineBuf[BUFSIZ];
  538. X  
  539. X      widthBits = GLYPHWIDTHPIXELS(pCI);
  540. X      height = GLYPHHEIGHTPIXELS(pCI);
  541. --- 63,69 ----
  542. X      unsigned char *pInBits,
  543. X                 *picture,
  544. X                 *line = NULL;
  545. !     char        lineBuf[BDFLINELEN];
  546. X  
  547. X      widthBits = GLYPHWIDTHPIXELS(pCI);
  548. X      height = GLYPHHEIGHTPIXELS(pCI);
  549. ***************
  550. *** 88,94 ****
  551. X  /*        0 width characters? */
  552. X  
  553. X      for (row = 0; row < height; row++) {
  554. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  555. X      if (!line)
  556. X          break;
  557. X  
  558. --- 89,95 ----
  559. X  /*        0 width characters? */
  560. X  
  561. X      for (row = 0; row < height; row++) {
  562. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  563. X      if (!line)
  564. X          break;
  565. X  
  566. ***************
  567. *** 136,142 ****
  568. X      }
  569. X  
  570. X      if ((line && (!bdfIsPrefix(line, "ENDCHAR"))) || (height == 0))
  571. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  572. X  
  573. X      if ((!line) || (!bdfIsPrefix(line, "ENDCHAR"))) {
  574. X      bdfError("missing 'ENDCHAR'\n");
  575. --- 137,143 ----
  576. X      }
  577. X  
  578. X      if ((line && (!bdfIsPrefix(line, "ENDCHAR"))) || (height == 0))
  579. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  580. X  
  581. X      if ((!line) || (!bdfIsPrefix(line, "ENDCHAR"))) {
  582. X      bdfError("missing 'ENDCHAR'\n");
  583. ***************
  584. *** 174,183 ****
  585. X  {
  586. X      unsigned char *line;
  587. X      int         i = 0;
  588. !     char        lineBuf[BUFSIZ];
  589. X  
  590. X      do {
  591. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  592. X      i++;
  593. X      } while (line && !bdfIsPrefix(line, "ENDCHAR") && i <= height);
  594. X  
  595. --- 175,184 ----
  596. X  {
  597. X      unsigned char *line;
  598. X      int         i = 0;
  599. !     char        lineBuf[BDFLINELEN];
  600. X  
  601. X      do {
  602. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  603. X      i++;
  604. X      } while (line && !bdfIsPrefix(line, "ENDCHAR") && i <= height);
  605. X  
  606. ***************
  607. *** 207,220 ****
  608. X                  ndx,
  609. X                  nchars,
  610. X                  nignored;
  611. !     int         char_row,
  612. !                 char_col;
  613. X      int         numEncodedGlyphs = 0;
  614. X      CharInfoPtr *bdfEncoding[256];
  615. X      BitmapFontPtr  bitmapFont;
  616. X      BitmapExtraPtr bitmapExtra;
  617. X      CARD32     *bitmapsSizes;
  618. !     char        lineBuf[BUFSIZ];
  619. X      int         nencoding;
  620. X  
  621. X      bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
  622. --- 208,220 ----
  623. X                  ndx,
  624. X                  nchars,
  625. X                  nignored;
  626. !     unsigned int char_row, char_col;
  627. X      int         numEncodedGlyphs = 0;
  628. X      CharInfoPtr *bdfEncoding[256];
  629. X      BitmapFontPtr  bitmapFont;
  630. X      BitmapExtraPtr bitmapExtra;
  631. X      CARD32     *bitmapsSizes;
  632. !     char        lineBuf[BDFLINELEN];
  633. X      int         nencoding;
  634. X  
  635. X      bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
  636. ***************
  637. *** 224,231 ****
  638. X      bitmapsSizes = bitmapExtra->bitmapsSizes;
  639. X      for (i = 0; i < GLYPHPADOPTIONS; i++)
  640. X          bitmapsSizes[i] = 0;
  641. -     bitmapExtra->glyphNames = 0;
  642. -     bitmapExtra->sWidths = 0;
  643. X      } else
  644. X      bitmapsSizes = NULL;
  645. X  
  646. --- 224,229 ----
  647. ***************
  648. *** 233,239 ****
  649. X      bitmapFont->metrics = NULL;
  650. X      ndx = 0;
  651. X  
  652. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  653. X  
  654. X      if ((!line) || (sscanf((char *) line, "CHARS %d", &nchars) != 1)) {
  655. X      bdfError("bad 'CHARS' in bdf file\n");
  656. --- 231,237 ----
  657. X      bitmapFont->metrics = NULL;
  658. X      ndx = 0;
  659. X  
  660. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  661. X  
  662. X      if ((!line) || (sscanf((char *) line, "CHARS %d", &nchars) != 1)) {
  663. X      bdfError("bad 'CHARS' in bdf file\n");
  664. ***************
  665. *** 267,273 ****
  666. X          return FALSE;
  667. X      }
  668. X      }
  669. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  670. X      pFont->info.firstRow = 256;
  671. X      pFont->info.lastRow = 0;
  672. X      pFont->info.firstCol = 256;
  673. --- 265,271 ----
  674. X          return FALSE;
  675. X      }
  676. X      }
  677. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  678. X      pFont->info.firstRow = 256;
  679. X      pFont->info.lastRow = 0;
  680. X      pFont->info.firstCol = 256;
  681. ***************
  682. *** 294,300 ****
  683. X      if (bitmapExtra)
  684. X          bitmapExtra->glyphNames[ndx] = bdfForceMakeAtom(charName, NULL);
  685. X  
  686. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  687. X      if (!line || (t = sscanf((char *) line, "ENCODING %d %d", &enc, &enc2)) < 1) {
  688. X          bdfError("bad 'ENCODING' in BDF file\n");
  689. X          goto BAILOUT;
  690. --- 292,298 ----
  691. X      if (bitmapExtra)
  692. X          bitmapExtra->glyphNames[ndx] = bdfForceMakeAtom(charName, NULL);
  693. X  
  694. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  695. X      if (!line || (t = sscanf((char *) line, "ENCODING %d %d", &enc, &enc2)) < 1) {
  696. X          bdfError("bad 'ENCODING' in BDF file\n");
  697. X          goto BAILOUT;
  698. ***************
  699. *** 342,348 ****
  700. X          }
  701. X      }
  702. X  
  703. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  704. X      if ((!line) || (sscanf((char *) line, "SWIDTH %d %d", &wx, &wy) != 2)) {
  705. X          bdfError("bad 'SWIDTH'\n");
  706. X          goto BAILOUT;
  707. --- 340,346 ----
  708. X          }
  709. X      }
  710. X  
  711. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  712. X      if ((!line) || (sscanf((char *) line, "SWIDTH %d %d", &wx, &wy) != 2)) {
  713. X          bdfError("bad 'SWIDTH'\n");
  714. X          goto BAILOUT;
  715. ***************
  716. *** 357,363 ****
  717. X  /* 5/31/89 (ef) -- we should be able to ditch the character and recover */
  718. X  /*        from all of these.                    */
  719. X  
  720. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  721. X      if ((!line) || (sscanf((char *) line, "DWIDTH %d %d", &wx, &wy) != 2)) {
  722. X          bdfError("bad 'DWIDTH'\n");
  723. X          goto BAILOUT;
  724. --- 355,361 ----
  725. X  /* 5/31/89 (ef) -- we should be able to ditch the character and recover */
  726. X  /*        from all of these.                    */
  727. X  
  728. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  729. X      if ((!line) || (sscanf((char *) line, "DWIDTH %d %d", &wx, &wy) != 2)) {
  730. X          bdfError("bad 'DWIDTH'\n");
  731. X          goto BAILOUT;
  732. ***************
  733. *** 366,372 ****
  734. X          bdfError("DWIDTH y value must be zero\n");
  735. X          goto BAILOUT;
  736. X      }
  737. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  738. X      if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) {
  739. X          bdfError("bad 'BBX'\n");
  740. X          goto BAILOUT;
  741. --- 364,370 ----
  742. X          bdfError("DWIDTH y value must be zero\n");
  743. X          goto BAILOUT;
  744. X      }
  745. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  746. X      if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) {
  747. X          bdfError("bad 'BBX'\n");
  748. X          goto BAILOUT;
  749. ***************
  750. *** 376,382 ****
  751. X               charName, bw, bh);
  752. X          goto BAILOUT;
  753. X      }
  754. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  755. X      if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) {
  756. X          for (p = line + strlen("ATTRIBUTES ");
  757. X              (*p == ' ') || (*p == '\t');
  758. --- 374,380 ----
  759. X               charName, bw, bh);
  760. X          goto BAILOUT;
  761. X      }
  762. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  763. X      if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) {
  764. X          for (p = line + strlen("ATTRIBUTES ");
  765. X              (*p == ' ') || (*p == '\t');
  766. ***************
  767. *** 383,389 ****
  768. X              p++)
  769. X           /* empty for loop */ ;
  770. X          ci->metrics.attributes = bdfHexByte(p) << 8 + bdfHexByte(p + 2);
  771. !         line = bdfGetLine(file, lineBuf, BUFSIZ);
  772. X      } else
  773. X          ci->metrics.attributes = 0;
  774. X  
  775. --- 381,387 ----
  776. X              p++)
  777. X           /* empty for loop */ ;
  778. X          ci->metrics.attributes = bdfHexByte(p) << 8 + bdfHexByte(p + 2);
  779. !         line = bdfGetLine(file, lineBuf, BDFLINELEN);
  780. X      } else
  781. X          ci->metrics.attributes = 0;
  782. X  
  783. ***************
  784. *** 413,419 ****
  785. X      } else
  786. X          bdfSkipBitmap(file, bh);
  787. X  
  788. !     line = bdfGetLine(file, lineBuf, BUFSIZ);    /* get STARTCHAR or
  789. X                               * ENDFONT */
  790. X      }
  791. X  
  792. --- 411,417 ----
  793. X      } else
  794. X          bdfSkipBitmap(file, bh);
  795. X  
  796. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);    /* get STARTCHAR or
  797. X                               * ENDFONT */
  798. X      }
  799. X  
  800. ***************
  801. *** 473,486 ****
  802. X      for (i = 0; i < 256; i++)
  803. X      if (bdfEncoding[i])
  804. X          xfree(bdfEncoding[i]);
  805. !     for (i = 0; i < ndx; i++)
  806. !     if (bitmapFont->metrics[i].bits)
  807. !         xfree(bitmapFont->metrics[i].bits);
  808. !     xfree(bitmapFont->metrics);
  809. !     if (bitmapExtra) {
  810. !     xfree(bitmapExtra->glyphNames);
  811. !     xfree(bitmapExtra->sWidths);
  812. !     }
  813. X      return (FALSE);
  814. X  }
  815. X  
  816. --- 471,477 ----
  817. X      for (i = 0; i < 256; i++)
  818. X      if (bdfEncoding[i])
  819. X          xfree(bdfEncoding[i]);
  820. !     /* bdfFreeFontBits will clean up the rest */
  821. X      return (FALSE);
  822. X  }
  823. X  
  824. ***************
  825. *** 492,513 ****
  826. X      bdfFileState *pState;
  827. X  {
  828. X      unsigned char *line;
  829. !     char        namebuf[BUFSIZ];
  830. X      int         tmp;
  831. !     char        lineBuf[BUFSIZ];
  832. X  
  833. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  834. X      if (!line || sscanf((char *) line, "STARTFONT %s", namebuf) != 1 ||
  835. X          !bdfStrEqual(namebuf, "2.1")) {
  836. X      bdfError("bad 'STARTFONT'\n");
  837. X      return (FALSE);
  838. X      }
  839. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  840. X      if (!line || sscanf((char *) line, "FONT %[^\n]", pState->fontName) != 1) {
  841. X      bdfError("bad 'FONT'\n");
  842. X      return (FALSE);
  843. X      }
  844. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  845. X      if (!line || !bdfIsPrefix(line, "SIZE")) {
  846. X      bdfError("missing 'SIZE'\n");
  847. X      return (FALSE);
  848. --- 483,504 ----
  849. X      bdfFileState *pState;
  850. X  {
  851. X      unsigned char *line;
  852. !     char        namebuf[BDFLINELEN];
  853. X      int         tmp;
  854. !     char        lineBuf[BDFLINELEN];
  855. X  
  856. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  857. X      if (!line || sscanf((char *) line, "STARTFONT %s", namebuf) != 1 ||
  858. X          !bdfStrEqual(namebuf, "2.1")) {
  859. X      bdfError("bad 'STARTFONT'\n");
  860. X      return (FALSE);
  861. X      }
  862. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  863. X      if (!line || sscanf((char *) line, "FONT %[^\n]", pState->fontName) != 1) {
  864. X      bdfError("bad 'FONT'\n");
  865. X      return (FALSE);
  866. X      }
  867. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  868. X      if (!line || !bdfIsPrefix(line, "SIZE")) {
  869. X      bdfError("missing 'SIZE'\n");
  870. X      return (FALSE);
  871. ***************
  872. *** 522,528 ****
  873. X      bdfError("SIZE values must be > 0\n");
  874. X      return (FALSE);
  875. X      }
  876. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  877. X      if (!line || !bdfIsPrefix(line, "FONTBOUNDINGBOX")) {
  878. X      bdfError("missing 'FONTBOUNDINGBOX'\n");
  879. X      return (FALSE);
  880. --- 513,519 ----
  881. X      bdfError("SIZE values must be > 0\n");
  882. X      return (FALSE);
  883. X      }
  884. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  885. X      if (!line || !bdfIsPrefix(line, "FONTBOUNDINGBOX")) {
  886. X      bdfError("missing 'FONTBOUNDINGBOX'\n");
  887. X      return (FALSE);
  888. ***************
  889. *** 542,555 ****
  890. X                  nextProp;
  891. X      char       *stringProps;
  892. X      FontPropPtr props;
  893. !     char        namebuf[BUFSIZ],
  894. !                 secondbuf[BUFSIZ],
  895. !                 thirdbuf[BUFSIZ];
  896. X      unsigned char *line;
  897. !     char        lineBuf[BUFSIZ];
  898. X      BitmapFontPtr  bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
  899. X  
  900. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  901. X      if (!line || !bdfIsPrefix(line, "STARTPROPERTIES")) {
  902. X      bdfError(file, "missing 'STARTPROPERTIES'\n");
  903. X      return (FALSE);
  904. --- 533,546 ----
  905. X                  nextProp;
  906. X      char       *stringProps;
  907. X      FontPropPtr props;
  908. !     char        namebuf[BDFLINELEN],
  909. !                 secondbuf[BDFLINELEN],
  910. !                 thirdbuf[BDFLINELEN];
  911. X      unsigned char *line;
  912. !     char        lineBuf[BDFLINELEN];
  913. X      BitmapFontPtr  bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
  914. X  
  915. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  916. X      if (!line || !bdfIsPrefix(line, "STARTPROPERTIES")) {
  917. X      bdfError(file, "missing 'STARTPROPERTIES'\n");
  918. X      return (FALSE);
  919. ***************
  920. *** 577,583 ****
  921. X      }
  922. X      nextProp = 0;
  923. X      while (nProps-- > 0) {
  924. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  925. X      if (line == NULL || bdfIsPrefix(line, "ENDPROPERTIES")) {
  926. X          bdfError("%d too few properites\n", nProps + 1);
  927. X          goto BAILOUT;
  928. --- 568,574 ----
  929. X      }
  930. X      nextProp = 0;
  931. X      while (nProps-- > 0) {
  932. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  933. X      if (line == NULL || bdfIsPrefix(line, "ENDPROPERTIES")) {
  934. X          bdfError("%d too few properites\n", nProps + 1);
  935. X          goto BAILOUT;
  936. ***************
  937. *** 600,605 ****
  938. --- 591,598 ----
  939. X          stringProps[nextProp] = TRUE;
  940. X          props[nextProp].value =
  941. X              bdfGetPropertyValue(line + strlen(namebuf) + 1);
  942. +         if (!props[nextProp].value)
  943. +             goto BAILOUT;
  944. X          break;
  945. X          } else if (bdfIsInteger(secondbuf)) {
  946. X          stringProps[nextProp] = FALSE;
  947. ***************
  948. *** 619,624 ****
  949. --- 612,619 ----
  950. X          stringProps[nextProp] = TRUE;
  951. X          props[nextProp].value =
  952. X              bdfGetPropertyValue(line + strlen(namebuf) + 1);
  953. +         if (!props[nextProp].value)
  954. +             goto BAILOUT;
  955. X          break;
  956. X          } else {
  957. X          bdfError("invalid '%s' parameter value\n", namebuf);
  958. ***************
  959. *** 635,642 ****
  960. X          nextProp++;
  961. X      }
  962. X  
  963. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  964. !     if (!bdfIsPrefix(line, "ENDPROPERTIES")) {
  965. X      bdfError("missing 'ENDPROPERTIES'\n");
  966. X      goto BAILOUT;
  967. X      }
  968. --- 630,637 ----
  969. X          nextProp++;
  970. X      }
  971. X  
  972. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  973. !     if (!line || !bdfIsPrefix(line, "ENDPROPERTIES")) {
  974. X      bdfError("missing 'ENDPROPERTIES'\n");
  975. X      goto BAILOUT;
  976. X      }
  977. ***************
  978. *** 717,723 ****
  979. X      pFont->info.props = NULL;
  980. X      }
  981. X      while (line && bdfIsPrefix(line, "ENDPROPERTIES"))
  982. !     line = bdfGetLine(file, lineBuf, BUFSIZ);
  983. X      return (FALSE);
  984. X  }
  985. X  
  986. --- 712,718 ----
  987. X      pFont->info.props = NULL;
  988. X      }
  989. X      while (line && bdfIsPrefix(line, "ENDPROPERTIES"))
  990. !     line = bdfGetLine(file, lineBuf, BDFLINELEN);
  991. X      return (FALSE);
  992. X  }
  993. X  
  994. ***************
  995. *** 755,760 ****
  996. --- 750,757 ----
  997. X      bitmapFont->encoding = 0;
  998. X      bitmapFont->pDefault = NULL;
  999. X      bitmapFont->bitmapExtra = (BitmapExtraPtr) xalloc(sizeof(BitmapExtraRec));
  1000. +     bitmapFont->bitmapExtra->glyphNames = 0;
  1001. +     bitmapFont->bitmapExtra->sWidths = 0;
  1002. X  
  1003. X      if (!bdfReadProperties(file, pFont, &state))
  1004. X      goto BAILOUT;
  1005. ***************
  1006. *** 763,771 ****
  1007. X      goto BAILOUT;
  1008. X  
  1009. X      if (state.haveDefaultCh) {
  1010. !     int         r,
  1011. !                 c,
  1012. !                 cols;
  1013. X  
  1014. X      r = pFont->info.defaultCh >> 8;
  1015. X      c = pFont->info.defaultCh & 0xFF;
  1016. --- 760,766 ----
  1017. X      goto BAILOUT;
  1018. X  
  1019. X      if (state.haveDefaultCh) {
  1020. !     unsigned int r, c, cols;
  1021. X  
  1022. X      r = pFont->info.defaultCh >> 8;
  1023. X      c = pFont->info.defaultCh & 0xFF;
  1024. ***************
  1025. *** 813,820 ****
  1026. X      if (state.weightProp && (state.weightProp->value == -1))
  1027. X      state.weightProp->value = bitmapComputeWeight(pFont);
  1028. X  
  1029. -     pFont->get_bitmaps = bitmapGetBitmaps;
  1030. -     pFont->get_extents = bitmapGetExtents;
  1031. X      pFont->get_glyphs = bitmapGetGlyphs;
  1032. X      pFont->get_metrics = bitmapGetMetrics;
  1033. X      pFont->unload_font = bdfUnloadFont;
  1034. --- 808,813 ----
  1035. ***************
  1036. *** 829,842 ****
  1037. --- 822,843 ----
  1038. X      FontPtr pFont;
  1039. X  {
  1040. X      BitmapFontPtr  bitmapFont;
  1041. +     BitmapExtraPtr bitmapExtra;
  1042. X      int         i;
  1043. X  
  1044. X      bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
  1045. +     bitmapExtra = (BitmapExtraPtr) bitmapFont->bitmapExtra;
  1046. X      xfree(bitmapFont->ink_metrics);
  1047. X      xfree(bitmapFont->encoding);
  1048. X      for (i = 0; i < bitmapFont->num_chars; i++)
  1049. X      xfree(bitmapFont->metrics[i].bits);
  1050. X      xfree(bitmapFont->metrics);
  1051. +     if (bitmapExtra)
  1052. +     {
  1053. +     xfree (bitmapExtra->glyphNames);
  1054. +     xfree (bitmapExtra->sWidths);
  1055. +     xfree (bitmapExtra);
  1056. +     }
  1057. X      xfree(pFont->info.props);
  1058. X      xfree(bitmapFont);
  1059. X  }
  1060. *** /tmp/da26013    Tue Jul 14 18:03:58 1992
  1061. --- mit/fonts/lib/font/bitmap/bdfutils.c    Tue Jul 14 18:03:57 1992
  1062. ***************
  1063. *** 22,28 ****
  1064. X  
  1065. X  ************************************************************************/
  1066. X  
  1067. ! /* $XConsortium: bdfutils.c,v 1.3 91/07/17 20:43:53 rws Exp $ */
  1068. X  
  1069. X  #include <ctype.h>
  1070. X  
  1071. --- 22,28 ----
  1072. X  
  1073. X  ************************************************************************/
  1074. X  
  1075. ! /* $XConsortium: bdfutils.c,v 1.6 92/04/16 09:20:57 gildea Exp $ */
  1076. X  
  1077. X  #include <ctype.h>
  1078. X  
  1079. ***************
  1080. *** 85,91 ****
  1081. X  /***====================================================================***/
  1082. X  
  1083. X  /*
  1084. !  * read the next (non-comment) line and keep a count for error messages
  1085. X   */
  1086. X  
  1087. X  unsigned char *
  1088. --- 85,92 ----
  1089. X  /***====================================================================***/
  1090. X  
  1091. X  /*
  1092. !  * read the next (non-comment) line and keep a count for error messages.
  1093. !  * Returns buf, or NULL if EOF.
  1094. X   */
  1095. X  
  1096. X  unsigned char *
  1097. ***************
  1098. *** 109,114 ****
  1099. --- 110,117 ----
  1100. X          *b++ = c;
  1101. X      }
  1102. X      *b = '\0';
  1103. +     if (c == FontFileEOF)
  1104. +         return NULL;
  1105. X      if (b != buf && !bdfIsPrefix(buf, "COMMENT"))
  1106. X          break;
  1107. X      }
  1108. ***************
  1109. *** 142,147 ****
  1110. --- 145,151 ----
  1111. X  {
  1112. X      register char *p,
  1113. X                 *pp;
  1114. +     char *orig_s = s;
  1115. X      Atom        atom;
  1116. X  
  1117. X      /* strip leading white space */
  1118. ***************
  1119. *** 148,154 ****
  1120. X      while (*s && (*s == ' ' || *s == '\t'))
  1121. X      s++;
  1122. X      if (*s == 0) {
  1123. !     return None;
  1124. X      }
  1125. X      if (*s != '"') {
  1126. X      pp = s;
  1127. --- 152,158 ----
  1128. X      while (*s && (*s == ' ' || *s == '\t'))
  1129. X      s++;
  1130. X      if (*s == 0) {
  1131. !     return bdfForceMakeAtom(s, NULL);
  1132. X      }
  1133. X      if (*s != '"') {
  1134. X      pp = s;
  1135. ***************
  1136. *** 167,178 ****
  1137. X      if (*s == '"') {
  1138. X          if (*(s + 1) != '"') {
  1139. X          *p++ = 0;
  1140. !         if (strlen(pp)) {
  1141. !             atom = bdfForceMakeAtom(pp, NULL);
  1142. !         } else {
  1143. !             atom = None;
  1144. !         }
  1145. !         free(pp);
  1146. X          return atom;
  1147. X          } else {
  1148. X          s++;
  1149. --- 171,178 ----
  1150. X      if (*s == '"') {
  1151. X          if (*(s + 1) != '"') {
  1152. X          *p++ = 0;
  1153. !         atom = bdfForceMakeAtom(pp, NULL);
  1154. !         xfree(pp);
  1155. X          return atom;
  1156. X          } else {
  1157. X          s++;
  1158. ***************
  1159. *** 180,185 ****
  1160. --- 180,187 ----
  1161. X      }
  1162. X      *p++ = *s++;
  1163. X      }
  1164. +     xfree (pp);
  1165. +     bdfError("unterminated quoted string property: %s\n", orig_s);
  1166. X      return None;
  1167. X  }
  1168. X  
  1169. *** /tmp/da26100    Tue Jul 14 18:04:06 1992
  1170. --- mit/fonts/lib/font/bitmap/bitscale.c    Tue Jul 14 18:04:05 1992
  1171. ***************
  1172. *** 1,5 ****
  1173. X  /*
  1174. !  * $XConsortium: bitscale.c,v 1.9 91/07/22 20:46:06 keith Exp $
  1175. X   *
  1176. X   * Copyright 1991 Massachusetts Institute of Technology
  1177. X   *
  1178. --- 1,5 ----
  1179. X  /*
  1180. !  * $XConsortium: bitscale.c,v 1.11 92/05/12 18:07:44 gildea Exp $
  1181. X   *
  1182. X   * Copyright 1991 Massachusetts Institute of Technology
  1183. X   *
  1184. ***************
  1185. *** 241,253 ****
  1186. X          }
  1187. X      }
  1188. X      }
  1189. !     if (best_scaled)
  1190. !     {
  1191. !     *best = best_scaled->vals;
  1192. !     *fpep = best_fpe;
  1193. !     *dxp = best_dx;
  1194. !     *dyp = best_dy;
  1195. !     }
  1196. X      return best_scaled->bitmap;
  1197. X  }
  1198. X  
  1199. --- 241,253 ----
  1200. X          }
  1201. X      }
  1202. X      }
  1203. !     if (!best_scaled)
  1204. !     return NULL;
  1205. !     *best = best_scaled->vals;
  1206. !     *fpep = best_fpe;
  1207. !     *dxp = best_dx;
  1208. !     *dyp = best_dy;
  1209. X      return best_scaled->bitmap;
  1210. X  }
  1211. X  
  1212. ***************
  1213. *** 434,441 ****
  1214. X      pf->glyph = opf->glyph;
  1215. X      pf->scan = opf->scan;
  1216. X  
  1217. -     pf->get_bitmaps = bitmapGetBitmaps;
  1218. -     pf->get_extents = bitmapGetExtents;
  1219. X      pf->get_glyphs = bitmapGetGlyphs;
  1220. X      pf->get_metrics = bitmapGetMetrics;
  1221. X      pf->unload_font = bitmapUnloadScalable;
  1222. --- 434,439 ----
  1223. ***************
  1224. *** 479,486 ****
  1225. X      pfi->anamorphic = FALSE;
  1226. X      if (heightMult != widthMult)
  1227. X      pfi->anamorphic = TRUE;
  1228. !     pfi->fontDescent *= heightMult;
  1229. !     pfi->fontAscent *= heightMult;
  1230. X      pfi->minbounds.leftSideBearing = MAXSHORT;
  1231. X      pfi->minbounds.rightSideBearing = MAXSHORT;
  1232. X      pfi->minbounds.ascent = MAXSHORT;
  1233. --- 477,487 ----
  1234. X      pfi->anamorphic = FALSE;
  1235. X      if (heightMult != widthMult)
  1236. X      pfi->anamorphic = TRUE;
  1237. !     newHeight = (opfi->fontAscent + opfi->fontDescent) * heightMult;
  1238. !     pfi->fontAscent = opfi->fontAscent * heightMult;
  1239. !     pfi->fontDescent = newHeight - pfi->fontAscent;
  1240. X      pfi->minbounds.leftSideBearing = MAXSHORT;
  1241. X      pfi->minbounds.rightSideBearing = MAXSHORT;
  1242. X      pfi->minbounds.ascent = MAXSHORT;
  1243. ***************
  1244. *** 616,621 ****
  1245. --- 617,623 ----
  1246. X              glyphBytes += BYTES_FOR_GLYPH(pci, glyph);
  1247. X          }
  1248. X          }
  1249. +     FontComputeInfoAccelerators (pfi);
  1250. X          xfree(scratch);
  1251. X      }
  1252. X  
  1253. ***************
  1254. *** 728,735 ****
  1255. X      if (pink) {
  1256. X      pink->leftSideBearing = MAXSHORT;
  1257. X      pink->rightSideBearing = MINSHORT;
  1258. !     pink->ascent = 0;
  1259. !     pink->descent = 0;
  1260. X      pink->characterWidth = pci->metrics.characterWidth;
  1261. X      pink->attributes = pci->metrics.attributes;
  1262. X      }
  1263. --- 730,737 ----
  1264. X      if (pink) {
  1265. X      pink->leftSideBearing = MAXSHORT;
  1266. X      pink->rightSideBearing = MINSHORT;
  1267. !     pink->ascent = MINSHORT;
  1268. !     pink->descent = MINSHORT;
  1269. X      pink->characterWidth = pci->metrics.characterWidth;
  1270. X      pink->attributes = pci->metrics.attributes;
  1271. X      }
  1272. ***************
  1273. *** 851,866 ****
  1274. X          if (newHeight >= pink->ascent)
  1275. X              pink->ascent = newHeight;
  1276. X          pink->descent = newHeight;
  1277. X          }
  1278. -         newBit = pci->metrics.leftSideBearing + newWidth - newBit - 1;
  1279. -         if (newBit < pink->leftSideBearing)
  1280. -         pink->leftSideBearing = newBit;
  1281. X          for (acc = scratch + newWidth, newBit = newWidth;
  1282. X              --newBit >= 0 && *--acc >= 0;
  1283. X          );
  1284. !         newBit = pci->metrics.leftSideBearing + newBit + 1;
  1285. !         if (newBit > pink->rightSideBearing)
  1286. !         pink->rightSideBearing = newBit;
  1287. X      }
  1288. X      }
  1289. X  #define MINMAX(field) \
  1290. --- 853,871 ----
  1291. X          if (newHeight >= pink->ascent)
  1292. X              pink->ascent = newHeight;
  1293. X          pink->descent = newHeight;
  1294. +         newBit = pci->metrics.leftSideBearing + newWidth - newBit - 1;
  1295. +         if (newBit < pink->leftSideBearing)
  1296. +             pink->leftSideBearing = newBit;
  1297. X          }
  1298. X          for (acc = scratch + newWidth, newBit = newWidth;
  1299. X              --newBit >= 0 && *--acc >= 0;
  1300. X          );
  1301. !         if (newBit >= 0)
  1302. !         {
  1303. !             newBit = pci->metrics.leftSideBearing + newBit + 1;
  1304. !             if (newBit > pink->rightSideBearing)
  1305. !             pink->rightSideBearing = newBit;
  1306. !         }
  1307. X      }
  1308. X      }
  1309. X  #define MINMAX(field) \
  1310. ***************
  1311. *** 870,875 ****
  1312. --- 875,889 ----
  1313. X      pFont->info.ink_maxbounds.field = pink->field
  1314. X  
  1315. X      if (pink) {
  1316. +     if (pink->ascent == MINSHORT)
  1317. +     {
  1318. +         /* hack to make computation below work */
  1319. +         pink->ascent = pci->metrics.descent;
  1320. +         /* these would also have not been set as this character is empty */
  1321. +         pink->descent = pink->ascent + 1;
  1322. +         pink->leftSideBearing = 0;
  1323. +         pink->rightSideBearing = 0;
  1324. +     }
  1325. X      height = pink->ascent - pink->descent + 1;
  1326. X      pink->ascent = pci->metrics.ascent -
  1327. X          (GLYPHHEIGHTPIXELS(pci) - pink->ascent);
  1328. ***************
  1329. *** 1045,1050 ****
  1330. --- 1059,1066 ----
  1331. X  
  1332. X      propCount = ComputeScaledProperties (&scaleInfo, fontName->name, vals, dx, dy,
  1333. X                      &props, &isStringProp);
  1334. +     xfree (scaleInfo.isStringProp);
  1335. +     xfree (scaleInfo.props);
  1336. X      if (propCount && (!props || !isStringProp))
  1337. X      return AllocError;
  1338. X  
  1339. *** /tmp/da26164    Tue Jul 14 18:04:13 1992
  1340. --- mit/fonts/lib/font/bitmap/pcfread.c    Tue Jul 14 18:04:12 1992
  1341. ***************
  1342. *** 1,5 ****
  1343. X  /*
  1344. !  * $XConsortium: pcfread.c,v 1.7 91/07/22 22:58:57 keith Exp $
  1345. X   *
  1346. X   * Copyright 1990 Massachusetts Institute of Technology
  1347. X   *
  1348. --- 1,5 ----
  1349. X  /*
  1350. !  * $XConsortium: pcfread.c,v 1.10 92/05/12 18:07:47 gildea Exp $
  1351. X   *
  1352. X   * Copyright 1990 Massachusetts Institute of Technology
  1353. X   *
  1354. ***************
  1355. *** 169,175 ****
  1356. X      for (i = 0; i < ntables; i++)
  1357. X      if (tables[i].type == type) {
  1358. X          if (position > tables[i].offset)
  1359. !         abort ();
  1360. X          if (!FontFileSkip(file, tables[i].offset - position))
  1361. X          return FALSE;
  1362. X          position = tables[i].offset;
  1363. --- 169,175 ----
  1364. X      for (i = 0; i < ntables; i++)
  1365. X      if (tables[i].type == type) {
  1366. X          if (position > tables[i].offset)
  1367. !         return FALSE;
  1368. X          if (!FontFileSkip(file, tables[i].offset - position))
  1369. X          return FALSE;
  1370. X          position = tables[i].offset;
  1371. ***************
  1372. *** 348,360 ****
  1373. X      CharInfoPtr metrics = 0;
  1374. X      xCharInfo  *ink_metrics = 0;
  1375. X      char       *bitmaps = 0;
  1376. !     CharInfoPtr *encoding;
  1377. X      int         nencoding;
  1378. X      int         encodingOffset;
  1379. X      CARD32      bitmapSizes[GLYPHPADOPTIONS];
  1380. !     CARD32     *offsets;
  1381. X      Bool    hasBDFAccelerators;
  1382. X  
  1383. X      if (!(tables = pcfReadTOC(file, &ntables)))
  1384. X      goto Bail;
  1385. X  
  1386. --- 348,361 ----
  1387. X      CharInfoPtr metrics = 0;
  1388. X      xCharInfo  *ink_metrics = 0;
  1389. X      char       *bitmaps = 0;
  1390. !     CharInfoPtr *encoding = 0;
  1391. X      int         nencoding;
  1392. X      int         encodingOffset;
  1393. X      CARD32      bitmapSizes[GLYPHPADOPTIONS];
  1394. !     CARD32     *offsets = 0;
  1395. X      Bool    hasBDFAccelerators;
  1396. X  
  1397. +     pFont->info.props = 0;
  1398. X      if (!(tables = pcfReadTOC(file, &ntables)))
  1399. X      goto Bail;
  1400. X  
  1401. ***************
  1402. *** 557,564 ****
  1403. X      }
  1404. X      bitmapFont->bitmapExtra = (BitmapExtraPtr) 0;
  1405. X      pFont->fontPrivate = (pointer) bitmapFont;
  1406. -     pFont->get_bitmaps = bitmapGetBitmaps;
  1407. -     pFont->get_extents = bitmapGetExtents;
  1408. X      pFont->get_glyphs = bitmapGetGlyphs;
  1409. X      pFont->get_metrics = bitmapGetMetrics;
  1410. X      pFont->unload_font = pcfUnloadFont;
  1411. --- 558,563 ----
  1412. ***************
  1413. *** 572,577 ****
  1414. --- 571,577 ----
  1415. X      xfree(ink_metrics);
  1416. X      xfree(encoding);
  1417. X      xfree(bitmaps);
  1418. +     xfree(offsets);
  1419. X      xfree(metrics);
  1420. X      xfree(pFont->info.props);
  1421. X      pFont->info.props = 0;
  1422. ***************
  1423. *** 592,597 ****
  1424. --- 592,600 ----
  1425. X      int         nencoding;
  1426. X      Bool    hasBDFAccelerators;
  1427. X  
  1428. +     pFontInfo->isStringProp = NULL;
  1429. +     pFontInfo->props = NULL;
  1430. X      if (!(tables = pcfReadTOC(file, &ntables)))
  1431. X      goto Bail;
  1432. X  
  1433. ***************
  1434. *** 639,644 ****
  1435. --- 642,649 ----
  1436. X      xfree(tables);
  1437. X      return Successful;
  1438. X  Bail:
  1439. +     xfree (pFontInfo->props);
  1440. +     xfree (pFontInfo->isStringProp);
  1441. X      xfree(tables);
  1442. X      return AllocError;
  1443. X  }
  1444. *** /tmp/da26186    Tue Jul 14 18:04:15 1992
  1445. --- mit/fonts/lib/font/bitmap/snfread.c    Tue Jul 14 18:04:14 1992
  1446. ***************
  1447. *** 22,28 ****
  1448. X  
  1449. X  ************************************************************************/
  1450. X  
  1451. ! /* $XConsortium: snfread.c,v 1.10 91/07/22 22:59:00 keith Exp $ */
  1452. X  
  1453. X  #include <ctype.h>
  1454. X  #include "fontfilest.h"
  1455. --- 22,28 ----
  1456. X  
  1457. X  ************************************************************************/
  1458. X  
  1459. ! /* $XConsortium: snfread.c,v 1.11 92/05/12 18:07:49 gildea Exp $ */
  1460. X  
  1461. X  #include <ctype.h>
  1462. X  #include "fontfilest.h"
  1463. ***************
  1464. *** 358,365 ****
  1465. X      }
  1466. X      bitmapFont->bitmapExtra = (BitmapExtraPtr) 0;
  1467. X      pFont->fontPrivate = (pointer) bitmapFont;
  1468. -     pFont->get_bitmaps = bitmapGetBitmaps;
  1469. -     pFont->get_extents = bitmapGetExtents;
  1470. X      pFont->get_glyphs = bitmapGetGlyphs;
  1471. X      pFont->get_metrics = bitmapGetMetrics;
  1472. X      pFont->unload_font = snfUnloadFont;
  1473. --- 358,363 ----
  1474. *** /tmp/da26443    Tue Jul 14 18:04:39 1992
  1475. --- mit/fonts/lib/font/util/format.c    Tue Jul 14 18:04:38 1992
  1476. ***************
  1477. *** 1,4 ****
  1478. ! /* $XConsortium: format.c,v 1.2 91/05/13 16:38:48 gildea Exp $ */
  1479. X  /*
  1480. X   * Copyright 1990, 1991 Network Computing Devices;
  1481. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  1482. --- 1,4 ----
  1483. ! /* $XConsortium: format.c,v 1.3 92/04/15 16:16:08 gildea Exp $ */
  1484. X  /*
  1485. X   * Copyright 1990, 1991 Network Computing Devices;
  1486. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  1487. ***************
  1488. *** 20,28 ****
  1489. X   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  1490. X   * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  1491. X   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1492. -  *
  1493. -  * @(#)format.c    4.1    91/05/02
  1494. -  *
  1495. X   */
  1496. X  
  1497. X  #include    "FSproto.h"
  1498. --- 20,25 ----
  1499. ***************
  1500. *** 29,39 ****
  1501. X  #include    "font.h"
  1502. X  
  1503. X  int
  1504. ! CheckFSFormat(format, fmask, bit, byte, scan, glyph, image)
  1505. X      fsBitmapFormat format;
  1506. X      fsBitmapFormatMask fmask;
  1507. !     int        *bit,
  1508. !                *byte,
  1509. X                 *scan,
  1510. X                 *glyph,
  1511. X                 *image;
  1512. --- 26,36 ----
  1513. X  #include    "font.h"
  1514. X  
  1515. X  int
  1516. ! CheckFSFormat(format, fmask, bit_order, byte_order, scan, glyph, image)
  1517. X      fsBitmapFormat format;
  1518. X      fsBitmapFormatMask fmask;
  1519. !     int        *bit_order,
  1520. !                *byte_order,
  1521. X                 *scan,
  1522. X                 *glyph,
  1523. X                 *image;
  1524. ***************
  1525. *** 40,51 ****
  1526. X  {
  1527. X      /* convert format to what the low levels want */
  1528. X      if (fmask & BitmapFormatMaskBit) {
  1529. !     *bit = format & BitmapFormatBitOrderMask;
  1530. !     *bit = (*bit == BitmapFormatBitOrderMSB) ? MSBFirst : LSBFirst;
  1531. X      }
  1532. X      if (fmask & BitmapFormatMaskByte) {
  1533. !     *byte = format & BitmapFormatByteOrderMask;
  1534. !     *byte = (*byte == BitmapFormatByteOrderMSB) ? MSBFirst : LSBFirst;
  1535. X      }
  1536. X      if (fmask & BitmapFormatMaskScanLineUnit) {
  1537. X      *scan = format & BitmapFormatScanlineUnitMask;
  1538. --- 37,50 ----
  1539. X  {
  1540. X      /* convert format to what the low levels want */
  1541. X      if (fmask & BitmapFormatMaskBit) {
  1542. !     *bit_order = format & BitmapFormatBitOrderMask;
  1543. !     *bit_order = (*bit_order == BitmapFormatBitOrderMSB)
  1544. !                  ? MSBFirst : LSBFirst;
  1545. X      }
  1546. X      if (fmask & BitmapFormatMaskByte) {
  1547. !     *byte_order = format & BitmapFormatByteOrderMask;
  1548. !     *byte_order = (*byte_order == BitmapFormatByteOrderMSB)
  1549. !                   ? MSBFirst : LSBFirst;
  1550. X      }
  1551. X      if (fmask & BitmapFormatMaskScanLineUnit) {
  1552. X      *scan = format & BitmapFormatScanlineUnitMask;
  1553. *** /tmp/da26570    Tue Jul 14 18:04:50 1992
  1554. --- mit/fonts/lib/font/util/Imakefile    Tue Jul 14 18:04:49 1992
  1555. ***************
  1556. *** 1,4 ****
  1557. ! XCOMM $XConsortium: Imakefile,v 1.8 91/10/18 11:22:58 keith Exp $
  1558. X  #include <Server.tmpl>
  1559. X  
  1560. X          INCLUDES = -I$(FONTSRC)/include -I../include -I$(FONTSERVERSRC)/include
  1561. --- 1,4 ----
  1562. ! XCOMM $XConsortium: Imakefile,v 1.9 92/05/15 11:15:42 gildea Exp $
  1563. X  #include <Server.tmpl>
  1564. X  
  1565. X          INCLUDES = -I$(FONTSRC)/include -I../include -I$(FONTSERVERSRC)/include
  1566. ***************
  1567. *** 7,16 ****
  1568. X       FORMAT_DEFS = FontFormatDefines
  1569. X  #endif
  1570. X              SRCS = bitmaputil.c fontnames.c fontutil.c fontxlfd.c format.c \
  1571. !            fontaccel.c atom.c miscutil.c private.c patcache.c fsfuncs.c
  1572. X  
  1573. X              OBJS = bitmaputil.o fontnames.o fontutil.o fontxlfd.o format.o \
  1574. !            fontaccel.o atom.o miscutil.o private.o patcache.o fsfuncs.o
  1575. X  
  1576. X  SubdirLibraryRule($(OBJS))
  1577. X  NormalLibraryObjectRule()
  1578. --- 7,16 ----
  1579. X       FORMAT_DEFS = FontFormatDefines
  1580. X  #endif
  1581. X              SRCS = bitmaputil.c fontnames.c fontutil.c fontxlfd.c format.c \
  1582. !            fontaccel.c atom.c miscutil.c private.c patcache.c
  1583. X  
  1584. X              OBJS = bitmaputil.o fontnames.o fontutil.o fontxlfd.o format.o \
  1585. !            fontaccel.o atom.o miscutil.o private.o patcache.o
  1586. X  
  1587. X  SubdirLibraryRule($(OBJS))
  1588. X  NormalLibraryObjectRule()
  1589. *** /tmp/da26634    Tue Jul 14 18:04:56 1992
  1590. --- mit/fonts/lib/font/util/patcache.c    Tue Jul 14 18:04:56 1992
  1591. ***************
  1592. *** 1,5 ****
  1593. X  /*
  1594. !  * $XConsortium: patcache.c,v 1.2 91/06/14 10:58:11 rws Exp $
  1595. X   *
  1596. X   * Copyright 1991 Massachusetts Institute of Technology
  1597. X   *
  1598. --- 1,5 ----
  1599. X  /*
  1600. !  * $XConsortium: patcache.c,v 1.3 92/03/23 16:46:12 keith Exp $
  1601. X   *
  1602. X   * Copyright 1991 Massachusetts Institute of Technology
  1603. X   *
  1604. ***************
  1605. *** 63,73 ****
  1606. X      if (!cache)
  1607. X      return 0;
  1608. X      for (i = 0; i < NENTRIES; i++)
  1609. -     {
  1610. -     cache->entries[i].patlen = 0;
  1611. X      cache->entries[i].pattern = 0;
  1612. -     cache->entries[i].pFont = 0;
  1613. -     }
  1614. X      EmptyFontPatternCache (cache);
  1615. X      return cache;
  1616. X  }
  1617. --- 63,69 ----
  1618. ***************
  1619. *** 113,118 ****
  1620. --- 109,117 ----
  1621. X      cache->entries[i].next = &cache->entries[i+1];
  1622. X      cache->entries[i].prev = 0;
  1623. X      cache->entries[i].pFont = 0;
  1624. +     xfree (cache->entries[i].pattern);
  1625. +     cache->entries[i].pattern = 0;
  1626. +     cache->entries[i].patlen = 0;
  1627. X      }
  1628. X      cache->free = &cache->entries[0];
  1629. X      cache->entries[i].next = 0;
  1630. *** /tmp/da26702    Tue Jul 14 18:05:05 1992
  1631. --- mit/fonts/lib/font/fc/fserve.c    Tue Jul 14 18:05:03 1992
  1632. ***************
  1633. *** 1,30 ****
  1634. ! /* $XConsortium: fserve.c,v 1.14 91/07/26 20:59:30 keith Exp $ */
  1635. X  /*
  1636. -  *
  1637. X   * Copyright 1990 Network Computing Devices
  1638. X   *
  1639. !  * Permission to use, copy, modify, distribute, and sell this software and its
  1640. !  * documentation for any purpose is hereby granted without fee, provided that
  1641. !  * the above copyright notice appear in all copies and that both that
  1642. X   * copyright notice and this permission notice appear in supporting
  1643. !  * documentation, and that the name of Network Computing Devices not be
  1644. !  * used in advertising or publicity pertaining to distribution of the
  1645. !  * software without specific, written prior permission.  Network Computing
  1646. !  * Devices makes no representations about the suitability of this software
  1647. !  * for any purpose.  It is provided "as is" without express or implied
  1648. !  * warranty.
  1649. X   *
  1650. !  * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  1651. !  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  1652. !  * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
  1653. !  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1654. !  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  1655. !  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  1656. !  * OR PERFORMANCE OF THIS SOFTWARE.
  1657. X   *
  1658. X   * Author:      Dave Lemke, Network Computing Devices, Inc
  1659. -  *
  1660. -  * $NCDId: @(#)fserve.c,v 1.19 1991/07/10 14:20:31 lemke Exp $
  1661. X   */
  1662. X  /*
  1663. X   * font server specific font access
  1664. --- 1,25 ----
  1665. ! /* $XConsortium: fserve.c,v 1.25 92/07/09 16:08:03 gildea Exp $ */
  1666. X  /*
  1667. X   * Copyright 1990 Network Computing Devices
  1668. X   *
  1669. !  * Permission to use, copy, modify, distribute, and sell this software and
  1670. !  * its documentation for any purpose is hereby granted without fee, provided
  1671. !  * that the above copyright notice appear in all copies and that both that
  1672. X   * copyright notice and this permission notice appear in supporting
  1673. !  * documentation, and that the names of Network Computing Devices, Digital or
  1674. !  * M.I.T. not be used in advertising or publicity pertaining to distribution
  1675. !  * of the software without specific, written prior permission.
  1676. X   *
  1677. !  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  1678. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  1679. !  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  1680. !  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  1681. !  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  1682. !  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  1683. !  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  1684. !  * THIS SOFTWARE.
  1685. X   *
  1686. X   * Author:      Dave Lemke, Network Computing Devices, Inc
  1687. X   */
  1688. X  /*
  1689. X   * font server specific font access
  1690. ***************
  1691. *** 43,52 ****
  1692. --- 38,57 ----
  1693. X  #include    <ncd/nvram.h>
  1694. X  #endif
  1695. X  
  1696. + #ifndef NULL
  1697. + #define NULL 0
  1698. + #endif
  1699. X  #ifndef MIN
  1700. X  #define MIN(a,b)    ((a)<(b)?(a):(b))
  1701. X  #endif
  1702. X  
  1703. + #define NONZEROMETRICS(pci) ((pci)->leftSideBearing || \
  1704. +                  (pci)->rightSideBearing || \
  1705. +                  (pci)->ascent || \
  1706. +                  (pci)->descent || \
  1707. +                  (pci)->characterWidth)
  1708. SHAR_EOF
  1709. true || echo 'restore of fix-13 failed'
  1710. fi
  1711. echo 'End of  part 1'
  1712. echo 'File fix-13 is continued in part 2'
  1713. echo 2 > _shar_seq_.tmp
  1714. exit 0
  1715. -- 
  1716. ---
  1717. Senior Systems Scientist        mail: dcmartin@msi.com
  1718. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1719. 796 North Pastoria Avenue        at&t: 408/522-9236
  1720.