summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2020-10-23 08:54:02 +0100
committerChris Liddell <chris.liddell@artifex.com>2020-10-23 10:55:47 +0100
commit9cdacf4e5efcf7b92ff7a02158a47ac04cc12fa7 (patch)
tree23e35775eebe81e6e4854d0e2f676005029b0b22
parent17cec404918eb458b63aba71fe680264f2a00179 (diff)
downloadghostpdl-9cdacf4e5efcf7b92ff7a02158a47ac04cc12fa7.tar.gz
Revise font dir global_glyph_code callback API
The global_glyph_code callback API relies on the name table being avaiable in the gs_lib_ctx and accessible via the gs_memory_t object. This is not something that is true, nor can we make it true, for pdfi. Because pdfi is required to integrate with the Postscript interpreter, we cannot have the gs_lib_ctx "top_of_system" pointer point to the pdfi context. So, change the global_glyph_code API so it takes a gs_font pointer, instead of a gs_memory_t pointer. The Postscript implementation will work exactly the same, just accessing the gs_memory_t through the gs_font pointer. But it allows pdfi to grab it's own context through the gs_font "client_data" pointer.
-rw-r--r--base/gxfcache.h2
-rw-r--r--devices/gxfcopy.c2
-rw-r--r--psi/zfont.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/base/gxfcache.h b/base/gxfcache.h
index b265f2f38..cc0c1bde9 100644
--- a/base/gxfcache.h
+++ b/base/gxfcache.h
@@ -261,7 +261,7 @@ struct gs_font_dir_s {
/* User parameter GridFitTT. */
uint grid_fit_tt;
gx_device_spot_analyzer *san;
- int (*global_glyph_code)(const gs_memory_t *mem, gs_const_string *gstr, gs_glyph *pglyph);
+ int (*global_glyph_code)(const gs_font *pfont, gs_const_string *gstr, gs_glyph *pglyph);
ulong text_enum_id; /* debug purpose only. */
};
diff --git a/devices/gxfcopy.c b/devices/gxfcopy.c
index 545e93f5e..c54156222 100644
--- a/devices/gxfcopy.c
+++ b/devices/gxfcopy.c
@@ -987,7 +987,7 @@ copied_type1_seac_data(gs_font_type1 * pfont, int ccode,
code = gs_c_glyph_name(glyph, gstr);
if (code < 0)
return code;
- code = pfont->dir->global_glyph_code(pfont->memory, gstr, &glyph1);
+ code = pfont->dir->global_glyph_code((gs_font *)pfont, gstr, &glyph1);
if (code < 0)
return code;
if (pglyph)
diff --git a/psi/zfont.c b/psi/zfont.c
index 5d7dd15ff..f13d52429 100644
--- a/psi/zfont.c
+++ b/psi/zfont.c
@@ -50,14 +50,14 @@ zfont_mark_glyph_name(const gs_memory_t *mem, gs_glyph glyph, void *ignore_data)
/* Get a global glyph code. */
static int
-zfont_global_glyph_code(const gs_memory_t *mem, gs_const_string *gstr, gs_glyph *pglyph)
+zfont_global_glyph_code(const gs_font *pbfont, gs_const_string *gstr, gs_glyph *pglyph)
{
ref v;
- int code = name_ref(mem, gstr->data, gstr->size, &v, 0);
+ int code = name_ref(pbfont->memory, gstr->data, gstr->size, &v, 0);
if (code < 0)
return code;
- *pglyph = (gs_glyph)name_index(mem, &v);
+ *pglyph = (gs_glyph)name_index(pbfont->memory, &v);
return 0;
}