From a1c34c0224d32ed4f9f2909863e8ac907c94524d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 4 Apr 2016 16:44:05 +0200 Subject: Add glyph names to trace device output. --- source/fitz/font.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/fitz/font.c') diff --git a/source/fitz/font.c b/source/fitz/font.c index cd5c7648..392e5a71 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -1401,6 +1401,23 @@ fz_advance_t3_glyph(fz_context *ctx, fz_font *font, int gid) return font->t3widths[gid]; } +void +fz_get_glyph_name(fz_context *ctx, fz_font *font, int glyph, char *buf, int size) +{ + FT_Face face = font->ft_face; + if (face) + { + if (FT_HAS_GLYPH_NAMES(face)) + FT_Get_Glyph_Name(face, glyph, buf, size); + else + fz_snprintf(buf, size, "%d", glyph); + } + else + { + fz_snprintf(buf, size, "%d", glyph); + } +} + float fz_advance_glyph(fz_context *ctx, fz_font *font, int gid, int wmode) { -- cgit v1.2.3