diff -r -c gnome-print-0.35/libgnomeprint/gp-truetype-utils.c gnome-print-0.35_new/libgnomeprint/gp-truetype-utils.c
*** gnome-print-0.35/libgnomeprint/gp-truetype-utils.c	Mon Nov  5 09:07:29 2001
--- gnome-print-0.35_new/libgnomeprint/gp-truetype-utils.c	Wed May  1 20:49:32 2002
***************
*** 103,114 ****
  		next = tables ? GPOINTER_TO_UINT (tables->data) : len;
  		size = next - start;
  		/* start new string, if we do not fit into limit */
! 		if ((stringsize + size) > GPTT_STRING_MAX) {
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (start));
  			stringsize = 0;
  		}
  		/* Test, whether current table fits at all */
! 		if (size > GPTT_STRING_MAX) {
  			if (start == glyf) {
  				slices = gp_tt_split_glyf (buf, start, next, loca, head, maxp, slices);
  				if (!slices) {
--- 103,114 ----
  		next = tables ? GPOINTER_TO_UINT (tables->data) : len;
  		size = next - start;
  		/* start new string, if we do not fit into limit */
! 		if ((stringsize + size) >= GPTT_STRING_MAX) {
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (start));
  			stringsize = 0;
  		}
  		/* Test, whether current table fits at all */
! 		if (size >= GPTT_STRING_MAX) {
  			if (start == glyf) {
  				slices = gp_tt_split_glyf (buf, start, next, loca, head, maxp, slices);
  				if (!slices) {
***************
*** 143,149 ****
  	guint32 offset;
  	gint i;
  
! 	indexToLocFormat = GUINT16FROMPTR (buf + head + 52);
  	numGlyphs = GUINT16FROMPTR (buf + maxp + 4);
  
  	start = glyf;
--- 143,149 ----
  	guint32 offset;
  	gint i;
  
! 	indexToLocFormat = GUINT16FROMPTR (buf + head + 50);
  	numGlyphs = GUINT16FROMPTR (buf + maxp + 4);
  
  	start = glyf;
***************
*** 153,166 ****
  		/* Short offsets */
  		for (i = 0; i < numGlyphs; i++) {
  			offset = glyf + GUINT16FROMPTR (buf + loca + 2 * i + 2) * 2;
! 			if ((offset - start) > GPTT_STRING_MAX) {
  				/* Write down current offset */
  				offset = glyf + GUINT16FROMPTR (buf + loca + 2 * i) * 2;
  				slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  				start = offset;
  			}
  		}
! 		if ((next - start) > GPTT_STRING_MAX) {
  			/* This is almost impossible condition - long pad */
  			offset = glyf + GUINT16FROMPTR (buf + loca + 2 * numGlyphs) * 2;
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
--- 153,166 ----
  		/* Short offsets */
  		for (i = 0; i < numGlyphs; i++) {
  			offset = glyf + GUINT16FROMPTR (buf + loca + 2 * i + 2) * 2;
! 			if ((offset - start) >= GPTT_STRING_MAX) {
  				/* Write down current offset */
  				offset = glyf + GUINT16FROMPTR (buf + loca + 2 * i) * 2;
  				slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  				start = offset;
  			}
  		}
! 		if ((next - start) >= GPTT_STRING_MAX) {
  			/* This is almost impossible condition - long pad */
  			offset = glyf + GUINT16FROMPTR (buf + loca + 2 * numGlyphs) * 2;
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
***************
*** 170,186 ****
  	case 1:
  		/* Long offsets */
  		for (i = 0; i < numGlyphs; i++) {
! 			offset = glyf + GUINT32FROMPTR (buf + loca + 4 * i + 4) * 2;
! 			if ((offset - start) > GPTT_STRING_MAX) {
  				/* Write down current offset */
! 				offset = glyf + GUINT32FROMPTR (buf + loca + 4 * i) * 2;
  				slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  				start = offset;
  			}
  		}
! 		if ((next - start) > GPTT_STRING_MAX) {
  			/* This is almost impossible condition - long pad */
! 			offset = glyf + GUINT32FROMPTR (buf + loca + 4 * numGlyphs) * 2;
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  			start = offset;
  		}
--- 170,186 ----
  	case 1:
  		/* Long offsets */
  		for (i = 0; i < numGlyphs; i++) {
! 			offset = glyf + GUINT32FROMPTR (buf + loca + 4 * i + 4);
! 			if ((offset - start) >= GPTT_STRING_MAX) {
  				/* Write down current offset */
! 				offset = glyf + GUINT32FROMPTR (buf + loca + 4 * i);
  				slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  				start = offset;
  			}
  		}
! 		if ((next - start) >= GPTT_STRING_MAX) {
  			/* This is almost impossible condition - long pad */
! 			offset = glyf + GUINT32FROMPTR (buf + loca + 4 * numGlyphs);
  			slices = g_slist_prepend (slices, GUINT_TO_POINTER (offset));
  			start = offset;
  		}
