From e9c71fab30fd1d5b163c8a072f9e2d3eb8ba3a92 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 7 Aug 2011 00:00:27 -0400 Subject: [PATCH] Fix name-table lookup Oops! --- src/hb-ot-name-private.hh | 2 +- src/hb-uniscribe-shape.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-name-private.hh b/src/hb-ot-name-private.hh index 3355bd9..d2acba1 100644 --- a/src/hb-ot-name-private.hh +++ b/src/hb-ot-name-private.hh @@ -92,7 +92,7 @@ struct name return 0; unsigned int length = MIN (buffer_length, (unsigned int) match->length); - memcmp (buffer, (this + stringOffset) + match->offset, length); + memcpy (buffer, (char *) this + stringOffset + match->offset, length); return length; } diff --git a/src/hb-uniscribe-shape.cc b/src/hb-uniscribe-shape.cc index 0934d5d..d6d3d79 100644 --- a/src/hb-uniscribe-shape.cc +++ b/src/hb-uniscribe-shape.cc @@ -81,9 +81,11 @@ populate_log_font (LOGFONTW *lf, DEBUG_MSG (UNISCRIBE, NULL, "Font name too long"); return FALSE; } + for (unsigned int i = 0; i < len; i++) lf->lfFaceName[i] = hb_be_uint16 (lf->lfFaceName[i]); lf->lfFaceName[len] = 0; + return TRUE; } -- 2.7.4