summaryrefslogtreecommitdiff
path: root/pxl/pxfont.c
diff options
context:
space:
mode:
authorStefan Kemper <stefan.kemper@artifex.com>2004-10-13 20:11:53 +0000
committerStefan Kemper <stefan.kemper@artifex.com>2004-10-13 20:11:53 +0000
commit838b69132b3d9e62cfabb93af8b34725caa526cc (patch)
treecf9ee6adc4425302ca22f67d0c8b6450f4030c5b /pxl/pxfont.c
parent6e82d5ab1d9c51d3f7376ce2e6d6048965dc1187 (diff)
Fix for pxl rotated bitmap font scaling.
Removed dead code in px_text for scaling px_set_char_matrix() now does the char matrix scaling for bitmaps the y axis flip is remove then page scaling is applied. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2138 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl/pxfont.c')
-rw-r--r--pxl/pxfont.c57
1 files changed, 6 insertions, 51 deletions
diff --git a/pxl/pxfont.c b/pxl/pxfont.c
index 7051a68f9..31bf233fe 100644
--- a/pxl/pxfont.c
+++ b/pxl/pxfont.c
@@ -38,16 +38,6 @@
#include "gxpath.h"
#include "gzstate.h"
-/*
- * There appears to be a combination of undocumented behavior and
- * firmware bugs in the H-P printers that make it difficult to determine
- * the proper interaction of character and page transformations.
- * The following two conditionals probably should not be enabled,
- * but we leave them here just in case this turns out to be wrong.
- */
-/*#define TRANSFORM_TEXT_AS_OBJECTS*/
-/*#define POST_TRANSFORM_CHARS*/
-
/* ---------------- Initialization ---------------- */
int
@@ -121,10 +111,10 @@ px_set_char_matrix(px_state_t *pxs)
)
return_error(pxs->memory, errorIllegalFontData);
gs_defaultmatrix(pxs->pgs, &mat);
- gs_make_scaling(
- adjust_scale(fabs(mat.xx + mat.yx) * 72 / pxfont->resolution.x),
- adjust_scale(fabs(mat.yy + mat.xy) * 72 / pxfont->resolution.y),
- &mat);
+
+ /* remove negative scale component */
+ gs_make_scaling( 1, 1, &mat );
+
/*
* Rotate the bitmap to undo the effect of its built-in
* orientation and add the page orientation rotation
@@ -386,44 +376,8 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path)
return code;
}
gs_currentmatrix(pgs, &save_ctm);
-
- if ( pxgs->base_font->scaling_technology == plfst_bitmap )
- { /*
- * Bitmap fonts don't scale or rotate: the char_matrix is the
- * actual matrix to use, aside from translation.
- */
- gs_matrix mat;
- mat = pxgs->char_matrix;
- mat.tx = save_ctm.tx;
- mat.ty = save_ctm.ty;
- gs_setmatrix(pgs, &mat);
- }
- else
-#ifdef TRANSFORM_TEXT_AS_OBJECTS
- /* Keep the current translation, but post-scale and rotate. */
- {
- gs_matrix tmat, rmat;
- tmat = pxs->initial_matrix;
- gs_matrix_rotate(&tmat, 90 * (int)pxs->orientation, &tmat);
- gs_matrix_multiply(&tmat, &pxgs->text_ctm, &tmat);
- gs_make_rotation(-90 * (int)pxs->orientation, &rmat);
- gs_matrix_multiply(&tmat, &rmat, &tmat);
- tmat.tx = save_ctm.tx;
- tmat.ty = save_ctm.ty;
- gs_setmatrix(pgs, &tmat);
- }
-#endif
-#ifdef POST_TRANSFORM_CHARS
- {
- gs_matrix cmat, mat;
- gs_currentmatrix(pgs, &cmat);
- gs_matrix_multiply(&cmat, &pxgs->char_matrix, &mat);
- gs_setmatrix(pgs, &mat);
- }
-#else
-
gs_concat(pgs, &pxgs->char_matrix);
-#endif
+
/* set the writing mode */
/* NB
@@ -627,6 +581,7 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path)
fvals[i*2] = font_distance.x;
fvals[i*2 +1] = font_distance.y;
+
}
// NB: this looks correct but pdfwrite isn't generating
// the correct information for text selection to compute spaces correctly.