A kludge to prevent gs from dividing by zero. The patch is probably wrong but fixes the problem for us. The bug is real and prevented us from viewing some documents. Notes: Wed Jul 13 18:14:41 EDT 2011 geoff yes, this fix isn't right, but i've found a suitable workaround and applied it. Reference: /n/sources/patch/applied/gsdivzero Date: Mon Jul 11 11:40:18 CES 2011 Signed-off-by: paurea@gmail.com Reviewed-by: geoff --- /sys/src/cmd/gs/src/gstype42.c Mon Jul 11 11:37:34 2011 +++ /sys/src/cmd/gs/src/gstype42.c Mon Jul 11 11:37:30 2011 @@ -672,13 +672,18 @@ simple_glyph_metrics(gs_font_type42 * pfont, uint glyph_index, int wmode, float sbw[4]) { + int (*string_proc)(gs_font_type42 *, ulong, uint, const byte **) = pfont->data.string_proc; - double factor = 1.0 / pfont->data.unitsPerEm; + double factor; uint width; int lsb; int code; - + int zzzzz = 0; /* hack, don't drive and read this code*/ + if(memcmp(&pfont->data.unitsPerEm, &zzzzz, sizeof(pfont->data.unitsPerEm))) + factor = 0.00001; + else + factor = 1.0 / pfont->data.unitsPerEm; { const gs_type42_mtx_t *pmtx = &pfont->data.metrics[wmode]; uint num_metrics = pmtx->numMetrics;