From 499782a60110312dc46ebb1bf9f504ca01392377 Mon Sep 17 00:00:00 2001 From: Henry Stiles Date: Wed, 17 Jun 2009 15:50:23 +0000 Subject: Clamp character shear operands to reasonable values. This should fix the nightly regression problems with the Quality Logic 310 series of files. We suspect it will fix bug #690241 comment #12 item 2, and it will effectively mask (not fix) bug #690541. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9798 a1074d23-0009-0410-80fe-cf8c14f379e6 --- pxl/pxgstate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pxl/pxgstate.c b/pxl/pxgstate.c index 0a29bad11..6d33d3a89 100644 --- a/pxl/pxgstate.c +++ b/pxl/pxgstate.c @@ -615,12 +615,22 @@ pxSetCharScale(px_args_t *par, px_state_t *pxs) const byte apxSetCharShear[] = { pxaCharShear, 0, 0 }; + + /* experiments indicate the character shearing operands are + clamped after range checking though it is not documented in + the HP manual. */ + +#define SHEAR_LIMIT 16383.0 + int pxSetCharShear(px_args_t *par, px_state_t *pxs) { real x_shear = real_value(par->pv[0], 0); real y_shear = real_value(par->pv[0], 1); px_gstate_t *pxgs = pxs->pxgs; + x_shear = x_shear > SHEAR_LIMIT ? SHEAR_LIMIT : x_shear; + y_shear = y_shear > SHEAR_LIMIT ? SHEAR_LIMIT : y_shear; + if ( x_shear != pxgs->char_shear.x || y_shear != pxgs->char_shear.y || pxgs->char_transforms[0] != pxct_shear ) -- cgit v1.2.3