diff options
Diffstat (limited to 'pdf/pdf_font.c')
-rw-r--r-- | pdf/pdf_font.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c index 65309a73..d86d4e6d 100644 --- a/pdf/pdf_font.c +++ b/pdf/pdf_font.c @@ -137,7 +137,7 @@ static int ft_cid_to_gid(pdf_font_desc *fontdesc, int cid) } int -pdf_font_cid_to_gid(pdf_font_desc *fontdesc, int cid) +pdf_font_cid_to_gid(fz_context *ctx, pdf_font_desc *fontdesc, int cid) { if (fontdesc->font->ft_face) return ft_cid_to_gid(fontdesc, cid); @@ -646,18 +646,18 @@ pdf_load_simple_font(pdf_document *xref, fz_obj *dict) } fontdesc->encoding = pdf_new_identity_cmap(ctx, 0, 1); - fontdesc->size += pdf_cmap_size(fontdesc->encoding); + fontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding); fontdesc->cid_to_gid_len = 256; fontdesc->cid_to_gid = etable; - pdf_load_to_unicode(fontdesc, xref, estrings, NULL, fz_dict_gets(dict, "ToUnicode")); + pdf_load_to_unicode(xref, fontdesc, estrings, NULL, fz_dict_gets(dict, "ToUnicode")); /* RJW: "cannot load to_unicode" */ skip_encoding: /* Widths */ - pdf_set_default_hmtx(fontdesc, fontdesc->missing_width); + pdf_set_default_hmtx(ctx, fontdesc, fontdesc->missing_width); widths = fz_dict_gets(dict, "Widths"); if (widths) @@ -687,7 +687,7 @@ pdf_load_simple_font(pdf_document *xref, fz_obj *dict) } } - pdf_end_hmtx(fontdesc); + pdf_end_hmtx(ctx, fontdesc); } fz_catch(ctx) { @@ -781,9 +781,9 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni { fz_throw(ctx, "syntaxerror: font missing encoding"); } - fontdesc->size += pdf_cmap_size(fontdesc->encoding); + fontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding); - pdf_set_font_wmode(fontdesc, pdf_get_wmode(fontdesc->encoding)); + pdf_set_font_wmode(ctx, fontdesc, pdf_get_wmode(ctx, fontdesc->encoding)); if (kind == TRUETYPE) { @@ -830,7 +830,7 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni } } - pdf_load_to_unicode(fontdesc, xref, NULL, collection, to_unicode); + pdf_load_to_unicode(xref, fontdesc, NULL, collection, to_unicode); /* RJW: "cannot load to_unicode" */ /* Horizontal */ @@ -839,7 +839,7 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni obj = fz_dict_gets(dict, "DW"); if (obj) dw = fz_to_int(obj); - pdf_set_default_hmtx(fontdesc, dw); + pdf_set_default_hmtx(ctx, fontdesc, dw); widths = fz_dict_gets(dict, "W"); if (widths) @@ -871,11 +871,11 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni } } - pdf_end_hmtx(fontdesc); + pdf_end_hmtx(ctx, fontdesc); /* Vertical */ - if (pdf_get_wmode(fontdesc->encoding) == 1) + if (pdf_get_wmode(ctx, fontdesc->encoding) == 1) { int dw2y = 880; int dw2w = -1000; @@ -887,7 +887,7 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni dw2w = fz_to_int(fz_array_get(obj, 1)); } - pdf_set_default_vmtx(fontdesc, dw2y, dw2w); + pdf_set_default_vmtx(ctx, fontdesc, dw2y, dw2w); widths = fz_dict_gets(dict, "W2"); if (widths) @@ -923,7 +923,7 @@ load_cid_font(pdf_document *xref, fz_obj *dict, fz_obj *encoding, fz_obj *to_uni } } - pdf_end_vmtx(fontdesc); + pdf_end_vmtx(ctx, fontdesc); } } fz_catch(ctx) @@ -1044,7 +1044,7 @@ pdf_make_width_table(fz_context *ctx, pdf_font_desc *fontdesc) for (k = fontdesc->hmtx[i].lo; k <= fontdesc->hmtx[i].hi; k++) { cid = pdf_lookup_cmap(fontdesc->encoding, k); - gid = pdf_font_cid_to_gid(fontdesc, cid); + gid = pdf_font_cid_to_gid(ctx, fontdesc, cid); if (gid > n) n = gid; } @@ -1059,7 +1059,7 @@ pdf_make_width_table(fz_context *ctx, pdf_font_desc *fontdesc) for (k = fontdesc->hmtx[i].lo; k <= fontdesc->hmtx[i].hi; k++) { cid = pdf_lookup_cmap(fontdesc->encoding, k); - gid = pdf_font_cid_to_gid(fontdesc, cid); + gid = pdf_font_cid_to_gid(ctx, fontdesc, cid); if (gid >= 0 && gid < font->width_count) font->width_table[gid] = fontdesc->hmtx[i].w; } @@ -1121,7 +1121,7 @@ pdf_load_font(pdf_document *xref, fz_obj *rdb, fz_obj *dict) } void -pdf_debug_font(pdf_font_desc *fontdesc) +pdf_debug_font(fz_context *ctx, pdf_font_desc *fontdesc) { int i; |