diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2007-02-13 22:31:51 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2007-02-13 22:31:51 +0000 |
commit | 69f1ec13452b565636c832c1d79474345e5705b1 (patch) | |
tree | 48602614eab153393194d776eda01375d4c7f1f7 /pxl/pxfont.c | |
parent | 0bf5afd2d784613d85210f8a50d968174371dc72 (diff) |
silently ignore 0 scaled fonts. Removes hack to adjust the shear
matrix anticipating and document it as an anomoly in hopes of avoiding
future maintenance problems.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2761 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl/pxfont.c')
-rw-r--r-- | pxl/pxfont.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pxl/pxfont.c b/pxl/pxfont.c index b815108b4..7ab943624 100644 --- a/pxl/pxfont.c +++ b/pxl/pxfont.c @@ -134,10 +134,6 @@ px_set_char_matrix(px_state_t *pxs) if ( pxgs->char_shear.x != 0 || pxgs->char_shear.y != 0 ) { gs_matrix smat; gs_make_identity(&smat); - if( pxgs->char_shear.x == 1 && pxgs->char_shear.y == 1) { - /* make 1 1 shear matrix invertable pxlfts2.0/t310.bin */ - pxgs->char_shear.y += 0.0001; - } smat.yx = pxgs->char_shear.x; smat.xy = pxgs->char_shear.y; gs_matrix_multiply(&smat, &mat, &mat); @@ -344,10 +340,18 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path) return_error(errorIllegalArraySize); if ( !pxgs->base_font ) return_error(errorNoCurrentFont); - if ( !pxgs->char_matrix_set ) { + if ( !pxgs->char_matrix_set ) { + gs_matrix *cm = &pxgs->char_matrix; + float det; code = px_set_char_matrix(pxs); if ( code < 0 ) return code; + /* check for a singular matrix - this does not generate an + interpreter error on hp. Casts prevent double precision + temporary variables, as in gsmatrix.c. */ + det = (float)(cm->xx * cm->yy) - (float)(cm->xy * cm->yx); + if ( det == 0 ) + return 0; } gs_setcharmatrix(pgs, &pxgs->char_matrix); |