int gs_itransform(gs_state * pgs, floatp x, floatp y, gs_point * pt) { /* If the matrix isn't skewed, we get more accurate results */ /* by using transform_inverse than by using the inverse matrix. */ if (!is_skewed(&pgs->ctm)) { return gs_point_transform_inverse(x, y, &ctm_only(pgs), pt); } else { ensure_inverse_valid(pgs); return gs_point_transform(x, y, &pgs->ctm_inverse, pt); } }
/* The caller must supply a string to the first call of gs_type1_interpret. */ int gs_type1_init(register gs_type1_state *pis, gs_show_enum *penum, int charpath_flag, int paint_type, gs_type1_data *pdata) { gs_state *pgs = penum->pgs; pis->penum = penum; pis->pgs = pgs; pis->pdata = pdata; pis->charpath_flag = charpath_flag; pis->paint_type = paint_type; pis->os_count = 0; pis->ips_count = 1; pis->seac_base = -1; pis->in_dotsection = 0; pis->vstem3_set = 0; pis->vs_offset.x = pis->vs_offset.y = 0; reset_stem_hints(pis); gx_matrix_to_fixed_coeff(&ctm_only(pgs), &pis->fc, max_coeff_bits); compute_font_hints(&pis->fh, &pgs->ctm, pdata); /* Set the current point of the path to the origin, */ /* in anticipation of the initial [h]sbw. */ { gx_path *ppath = pgs->path; ppath->position.x = pgs->ctm.tx_fixed; ppath->position.y = pgs->ctm.ty_fixed; } /* Set the flatness to a value that is likely to produce */ /* reasonably good-looking curves, regardless of its */ /* current value in the graphics state. */ { /* If the character is very small, set the flatness */ /* to zero, which will produce very accurate curves. */ float cxx = pgs->ctm.xx, cyy = pgs->ctm.yy; if ( cxx < 0 ) cxx = -cxx; if ( cyy < 0 ) cyy = -cyy; if ( cyy > cxx ) cxx = cyy; if ( is_skewed(&pgs->ctm) ) { float cxy = pgs->ctm.xy, cyx = pgs->ctm.yx; if ( cxy < 0 ) cxy = -cxy; if ( cyx < 0 ) cyx = -cyx; if ( cxy > cxx ) cxx = cxy; if ( cyx > cxx ) cxx = cyx; } /* Now cxx is approximately one character space unit */ /* in device pixels. */ pis->flatness = (cxx >= 0.2 ? cxx : 0.0); } return 0; }