Article View: comp.text
Article #3895bug fix for ctex lib/pkfont.c 2.7
From: Chris Torek
Date: Fri, 21 Aug 1987 16:54
Date: Fri, 21 Aug 1987 16:54
109 lines
3404 bytes
3404 bytes
If you are using my prerelease version of ctex and have pkfont
revision 2.7, here is a fix for embedded PK `special' commands.
RCS file: RCS/pkfont.c,v
retrieving revision 2.7
retrieving revision 2.8
diff -c2 -r2.7 -r2.8
*** /tmp/,RCSt1027687 Fri Aug 21 12:46:54 1987
--- /tmp/,RCSt2027687 Fri Aug 21 12:46:56 1987
***************
*** 6,10 ****
#ifndef lint
! static char rcsid[] = "$Header: pkfont.c,v 2.7 87/06/16 18:28:31 chris Exp $";
#endif
--- 6,10 ----
#ifndef lint
! static char rcsid[] = "$Header: pkfont.c,v 2.8 87/08/21 12:44:28 chris Exp $";
#endif
***************
*** 85,89 ****
int pk_gleft; /* number of valid glyphs left uninterpreted */
struct cp pk_cpack[MAXSTD]; /* for characters in [0..MAXSTD) */
! struct cp *pk_morec; /* for characters in [MAXSTD..maxc) */
};
--- 85,89 ----
int pk_gleft; /* number of valid glyphs left uninterpreted */
struct cp pk_cpack[MAXSTD]; /* for characters in [0..MAXSTD) */
! struct cp *pk_morec; /* for characters in [MAXSTD..maxc] */
};
***************
*** 276,280 ****
f->f_details = (char *) pk;
- skip_specials(f); /* skip any special commands */
/* scan the characters, fail if necessary */
--- 276,279 ----
***************
*** 321,325 ****
register char *p;
register struct cp *cp;
- char *packet;
int type;
--- 320,323 ----
***************
*** 340,348 ****
/*
* Loop through the packets until we reach a POST, skipping
! * the glyph instructions themselves after each definition.
*/
! for (p = pk->pk_ptr; (c = pgetbyte(p)) != PK_POST; p += pl) {
! /* remember packet address for this character */
! packet = p - 1;
/*
--- 338,349 ----
/*
* Loop through the packets until we reach a POST, skipping
! * the glyph instructions themselves after each definition,
! * and specials (if any) before each.
*/
! for (;; pk->pk_ptr = p + pl) {
! skip_specials(f);
! p = pk->pk_ptr;
! if ((c = pgetbyte(p)) == PK_POST)
! break; /* whoops, done after all */
/*
***************
*** 392,396 ****
cp = &pk->pk_cpack[c];
! cp->cp_packet = packet;
cp->cp_type = type;
--- 393,397 ----
cp = &pk->pk_cpack[c];
! cp->cp_packet = pk->pk_ptr;
cp->cp_type = type;
***************
*** 425,430 ****
if (i < MAXSTD)
cp = &pk->pk_cpack[i];
! else
cp = &pk->pk_morec[i - MAXSTD];
p = cp->cp_packet;
if (p == NULL) /* glyph is not valid */
--- 426,434 ----
if (i < MAXSTD)
cp = &pk->pk_cpack[i];
! else {
! if (i > pk->pk_maxc)
! panic("pk_getgly(%s, %d)", f->f_path, i);
cp = &pk->pk_morec[i - MAXSTD];
+ }
p = cp->cp_packet;
if (p == NULL) /* glyph is not valid */
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris
Technical Details
Message-ID:
<8074@mimsy.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!mimsy!chrisShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.text Subject: bug fix for ctex lib/pkfont.c 2.7 Message-ID: <8074@mimsy.UUCP> Date: Fri, 21-Aug-87 12:54:07 EDT Article-I.D.: mimsy.8074 Posted: Fri Aug 21 12:54:07 1987 Date-Received: Sun, 23-Aug-87 04:51:25 EDT Organization: University of Maryland, Dept. of Computer Sci. Lines: 109