[gs-commits] rev 11601 - trunk/gs/psi
chrisl at ghostscript.com
chrisl at ghostscript.com
Thu Aug 5 17:40:37 UTC 2010
Author: chrisl
Date: 2010-08-05 17:40:36 +0000 (Thu, 05 Aug 2010)
New Revision: 11601
Modified:
trunk/gs/psi/fapi_ft.c
trunk/gs/psi/zfapi.c
Log:
The "show" machinery expected that even non-marking text operations
(such as stringwidth) would result in a glyph bitmap which
could be cached (assuming the glyph would be a candidate for the
cache with a normal marking operation, like show).
FAPI, however, did not create a glyph bitmap for non-marking
operations, thus the cache would receive a valid, but
"empty" glyph. This caused Postscript that used stringwidth
before a show to sometimes "lose" glyphs, by using the empty
cached glyph.
FAPI's behaviour now matches the expectations of the show/cache
management code.
Causes cluster differences in Bug688372.ps, fts_31_3111.pdf, and
14-08.PS, these are all progressions.
Bug 691517
Modified: trunk/gs/psi/fapi_ft.c
===================================================================
--- trunk/gs/psi/fapi_ft.c 2010-08-05 15:49:39 UTC (rev 11600)
+++ trunk/gs/psi/fapi_ft.c 2010-08-05 17:40:36 UTC (rev 11601)
@@ -978,7 +978,8 @@
static FAPI_retcode
get_char_width(FAPI_server *a_server, FAPI_font *a_font, FAPI_char_ref *a_char_ref, FAPI_metrics *a_metrics)
{
- return load_glyph(a_font, a_char_ref, a_metrics, NULL, false);
+ FF_server *s = (FF_server*)a_server;
+ return load_glyph(a_font, a_char_ref, a_metrics, (FT_Glyph*)&s->bitmap_glyph, true);
}
static FAPI_retcode get_fontmatrix(FAPI_server *server, gs_matrix *m)
Modified: trunk/gs/psi/zfapi.c
===================================================================
--- trunk/gs/psi/zfapi.c 2010-08-05 15:49:39 UTC (rev 11600)
+++ trunk/gs/psi/zfapi.c 2010-08-05 17:40:36 UTC (rev 11601)
@@ -1631,14 +1631,16 @@
dev1 = gs_currentdevice_inline(pgs); /* Possibly changed by zchar_set_cache. */
- if (SHOW_IS(penum, TEXT_DO_NONE)) {
- /* do nothing */
- } else if (igs->in_charpath) {
+ /* Even for "non-marking" text operations (for example, stringwidth) we are expected
+ * to have a glyph bitmap for the cache, if we're using the cache. For the
+ * non-cacheing, non-marking cases, we must not draw the glyph.
+ */
+ if (igs->in_charpath && !SHOW_IS(penum, TEXT_DO_NONE)) {
if ((code = outline_char(i_ctx_p, I, import_shift_v, penum_s, pgs->show_gstate->path, !pbfont->PaintType)) < 0)
return code;
} else {
int code = I->get_char_raster(I, &rast);
- if (code == e_limitcheck || pbfont->PaintType) {
+ if (!SHOW_IS(penum, TEXT_DO_NONE) && (code == e_limitcheck || pbfont->PaintType)) {
/* The server provides an outline instead the raster. */
gs_imager_state *pis = (gs_imager_state *)pgs->show_gstate;
gs_point pt;
@@ -1711,7 +1713,7 @@
penum_s->cc->offset.y += float2fixed(penum_s->fapi_glyph_shift.y);
}
}
- } else { /* Not using GS cache */
+ } else if (!SHOW_IS(penum, TEXT_DO_NONE)) { /* Not using GS cache */
const gx_clip_path * pcpath = i_ctx_p->pgs->clip_path;
const gx_drawing_color * pdcolor = penum->pdcolor;
@@ -2211,6 +2213,7 @@
#if 0 /* Debug purpose only: search chars in UFST fonts. */
cr.char_code = client_char_code; /* remove for release !!!!!!!!!!!!!!!! */
#endif
+
/* Provide glyph data for renderer : */
if (!I->ff.is_cid) {
ref sname;
More information about the gs-commits
mailing list