summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gs/psi/write_t1.c29
-rw-r--r--gs/psi/zfapi.c7
2 files changed, 26 insertions, 10 deletions
diff --git a/gs/psi/write_t1.c b/gs/psi/write_t1.c
index 5ed1c401f..132d43fd0 100644
--- a/gs/psi/write_t1.c
+++ b/gs/psi/write_t1.c
@@ -300,15 +300,26 @@ static void write_main_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output, i
WRF_wstring(a_output, "] def\n");
}
WRF_wstring(a_output,"end readonly def\n");
- WRF_wstring(a_output,"/$Blend {");
- x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend_length,0);
- if(a_output->m_count)
- a_output->m_count += x;
- x = a_fapi_font->get_proc(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend,0,(char *)a_output->m_pos);
- if(a_output->m_pos)
- a_output->m_pos += x;
- WRF_wstring(a_output,"} def\n");
- WRF_wstring(a_output,"/$Blend {0.1 mul exch 0.45 mul add exch 0.17 mul add add} def\n");
+
+ /* Previously we tried to write $Blend twice - the "real" one from the font,
+ * and the boiler plate one below.
+ * For now, I assume there was a good reason for including the second, but it may
+ * be because the "get_proc" method below was missing the code to handle PS name
+ * objects.
+ */
+ if ((x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend_length,0)) > 0) {
+ WRF_wstring(a_output,"/$Blend {");
+
+ if(a_output->m_count)
+ a_output->m_count += x;
+ x = a_fapi_font->get_proc(a_fapi_font,FAPI_FONT_FEATURE_DollarBlend,0,(char *)a_output->m_pos);
+ if(a_output->m_pos)
+ a_output->m_pos += x;
+ WRF_wstring(a_output,"} def\n");
+ }
+ else {
+ WRF_wstring(a_output,"/$Blend {0.1 mul exch 0.45 mul add exch 0.17 mul add add} def\n");
+ }
WRF_wstring(a_output,"/WeightVector [");
x = a_fapi_font->get_word(a_fapi_font,FAPI_FONT_FEATURE_WeightVector_count,0);
for (i = 0;i < x;i++) {
diff --git a/gs/psi/zfapi.c b/gs/psi/zfapi.c
index bc05e755d..29ec6d40b 100644
--- a/gs/psi/zfapi.c
+++ b/gs/psi/zfapi.c
@@ -817,7 +817,7 @@ static int FAPI_FF_get_proc(FAPI_font *ff, fapi_font_feature var_id, int index,
switch((int)var_id) {
case FAPI_FONT_FEATURE_DollarBlend:
- { ref *DBlend, Element;
+ { ref *DBlend, Element, string;
int i;
char Buf[32];
if (dict_find_string(pdr, "$Blend", &DBlend) <= 0)
@@ -827,6 +827,11 @@ static int FAPI_FF_get_proc(FAPI_font *ff, fapi_font_feature var_id, int index,
if (array_get(ff->memory, DBlend, i, &Element) < 0)
return 0;
switch (r_btype(&Element)) {
+ case t_name:
+ name_string_ref(ff->memory, &Element, &string);
+ strncpy(ptr, string.value.const_bytes, r_size(&string));
+ ptr += r_size(&string);
+ break;
case t_real:
sprintf(Buf, "%f", Element.value.realval);
strcpy(ptr, Buf);