diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2007-08-15 06:12:50 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2007-08-15 06:12:50 +0000 |
commit | 83c6d04bf68553ad512c83b7810386112b405471 (patch) | |
tree | 7c731841b66ec5aaa9cabbfed9e93bbf14db58ac /pxl | |
parent | 3c809962efdff897e208ea5e55af71c4a994deab (diff) |
Modifications for pcl, pxl, and xps so text works properly with high
level devices, the clients did not set orig_FontMatrix or FontMatrix,
instead gs_setcharmatrix was used to express character scaling. This
does not work with devices like pdfwrite which don't have access to
the character matrix. It does not suffice to simply set the
FontMatrix, setcharmatrix still must be used so the cache machinery is
aware of the character matrix. Thanks to Igor for helping out with this.
NOTES:
1) XPS changes were not tested.
2) pcl and gl do not use a character matrix. The scaling information
is concatenated into the ctm. XL and XPS do use a character scaling
matrix.
3) This modification has been hurried together for a release, we hope
to build a simpler interface for font scaling by non-postscript
clients later.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@2886 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl')
-rw-r--r-- | pxl/pxerrors.c | 4 | ||||
-rw-r--r-- | pxl/pxfont.c | 8 | ||||
-rw-r--r-- | pxl/pxstate.c | 23 |
3 files changed, 10 insertions, 25 deletions
diff --git a/pxl/pxerrors.c b/pxl/pxerrors.c index d21f9da30..68f4b4d7d 100644 --- a/pxl/pxerrors.c +++ b/pxl/pxerrors.c @@ -249,10 +249,12 @@ px_begin_error_page(px_state_t *pxs) /*pxSetPageDefaultCTM(NULL, pxs);*/ { gs_point pt; + gs_font *pfont = pxs->error_page_font->pfont; px_get_default_media_size(pxs, &pt); gs_translate(pgs, 0.0, pt.y); gs_scale(pgs, 1.0, -1.0); - gs_setfont(pgs, (gs_font *)pxs->error_page_font->pfont); + gs_setfont(pgs, pfont); + pfont->FontMatrix = pfont->orig_FontMatrix; return 90; } } diff --git a/pxl/pxfont.c b/pxl/pxfont.c index c1d2d4579..2f11bad9d 100644 --- a/pxl/pxfont.c +++ b/pxl/pxfont.c @@ -337,6 +337,7 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path) int code = 0; gs_char *pchr = 0; pl_font_t *plfont; + gs_matrix save_ctm; if ( pfont == 0 ) return_error(errorNoCurrentFont); @@ -362,7 +363,13 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path) return 0; } + /* set the character matrix in the graphics state */ gs_setcharmatrix(pgs, &pxgs->char_matrix); + /* The character matrix is not visible to devices. High level + devices get character scaling information from the font's + matrix (FontMatrix). */ + gs_matrix_multiply(&pxgs->char_matrix, &pfont->orig_FontMatrix, + &pfont->FontMatrix); /* we don't need to consider the vertical mess for resident fonts */ if (plfont->storage != pxfsDownLoaded) { pfont->WMode = 0; /* horizontal */ @@ -407,7 +414,6 @@ px_text(px_args_t *par, px_state_t *pxs, bool to_path) len, mem, &penum, to_path, pxgs->char_bold_value == 0); - if ( code >= 0 ) { code = gs_text_process(penum); gs_text_release(penum, "pxtext"); diff --git a/pxl/pxstate.c b/pxl/pxstate.c index 7b23689a9..60d13090f 100644 --- a/pxl/pxstate.c +++ b/pxl/pxstate.c @@ -68,29 +68,6 @@ px_state_release(px_state_t *pxs) px_dict_release(&pxs->font_dict); gs_free_object(pxs->memory, pxs->error_page_show_enum, "px_state_release(pxs->error_page_show_enum)"); - - /* free character cache machinery */ - gs_free_object(pxs->memory, pxs->font_dir->fmcache.mdata, "px_state_release"); - { - /* free the circular list of memory chunks first */ - gx_bits_cache_chunk *chunk = pxs->font_dir->ccache.chunks; - gx_bits_cache_chunk *start_chunk = chunk; - gx_bits_cache_chunk *prev_chunk; - while (1) { - if (start_chunk == chunk->next) { - gs_free_object(pxs->memory, chunk->data, "px_state_release"); - gs_free_object(pxs->memory, chunk, "px_state_release"); - break; - } - prev_chunk = chunk; - chunk = chunk->next; - gs_free_object(pxs->memory, prev_chunk->data, "px_state_release"); - gs_free_object(pxs->memory, prev_chunk, "px_state_release"); - } - } - gs_free_object(pxs->memory, pxs->font_dir->ccache.table, "px_state_release"); - /* free gs font dir */ - gs_free_object(pxs->memory, pxs->font_dir, "px_state_release(gs_font_dir)"); /* Don't free pxgs since it'll get freed as pgs' client */ gs_free_object(pxs->memory, pxs, "px_state_release"); } |