From 4ce578ed369f1526c91deedcf9e72537b3e4328f Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Mon, 3 May 2010 15:03:53 -0400 Subject: [PATCH 1/2] Include the tags from the Apple specification for TrueType fonts --- src/hb-open-file-private.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 83f65710f..aa49df5de 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -198,6 +198,8 @@ struct OpenTypeFontFile static const hb_tag_t CFFTag = HB_TAG ('O','T','T','O'); static const hb_tag_t TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ); static const hb_tag_t TTCTag = HB_TAG ('t','t','c','f'); + static const hb_tag_t TrueTag = HB_TAG ('t','r','u','e'); + static const hb_tag_t Typ1Tag = HB_TAG ('t','y','p','1'); inline hb_tag_t get_tag (void) const { return u.tag; } @@ -205,6 +207,8 @@ struct OpenTypeFontFile { switch (u.tag) { case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: case TrueTypeTag: return 1; case TTCTag: return u.ttcHeader->get_face_count (); default: return 0; @@ -217,6 +221,8 @@ struct OpenTypeFontFile * Apple dfont container is a container of SFNT's. So each SFNT is a * non-TTC, but the index is more than zero. */ case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: case TrueTypeTag: return u.fontFace[0]; case TTCTag: return u.ttcHeader->get_face (i); default: return Null(OpenTypeFontFace); @@ -228,6 +234,8 @@ struct OpenTypeFontFile if (!SANITIZE (u.tag)) return false; switch (u.tag) { case CFFTag: /* All the non-collection tags */ + case TrueTag: + case Typ1Tag: case TrueTypeTag: return u.fontFace->sanitize (SANITIZE_ARG); case TTCTag: return u.ttcHeader->sanitize (SANITIZE_ARG); default: return true; From eaf29edb8fa49390e5f48b78105dfd173aff445b Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Mon, 3 May 2010 22:27:56 -0400 Subject: [PATCH 2/2] HB_UNUSED is unneeded on static inline functions --- src/hb-object-private.h | 2 +- src/hb-open-type-private.hh | 6 +++--- src/hb-private.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-object-private.h b/src/hb-object-private.h index 937b1df93..2f5429ffb 100644 --- a/src/hb-object-private.h +++ b/src/hb-object-private.h @@ -62,7 +62,7 @@ typedef struct { #define HB_DEBUG_OBJECT HB_DEBUG+0 #endif -static HB_UNUSED inline hb_bool_t /* always returns TRUE */ +static inline hb_bool_t /* always returns TRUE */ _hb_object_debug_out (const void *obj, hb_reference_count_t *ref_count, const char *function) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index bbd88a73d..d4c2fd598 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -171,7 +171,7 @@ _hb_sanitize_fini (hb_sanitize_context_t *context HB_UNUSED, hb_blob_unlock (blob); } -static HB_UNUSED inline bool +static inline bool _hb_sanitize_check (SANITIZE_ARG_DEF, const char *base, unsigned int len) @@ -191,7 +191,7 @@ _hb_sanitize_check (SANITIZE_ARG_DEF, return ret; } -static HB_UNUSED inline bool +static inline bool _hb_sanitize_array (SANITIZE_ARG_DEF, const char *base, unsigned int record_size, @@ -211,7 +211,7 @@ _hb_sanitize_array (SANITIZE_ARG_DEF, return HB_LIKELY (!overflows) && _hb_sanitize_check (SANITIZE_ARG, base, record_size * len); } -static HB_UNUSED inline bool +static inline bool _hb_sanitize_edit (SANITIZE_ARG_DEF, const char *base HB_UNUSED, unsigned int len HB_UNUSED) diff --git a/src/hb-private.h b/src/hb-private.h index 9130b0464..1ee98c730 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -161,7 +161,7 @@ * in libgcc in case a target does not have one, which should be just as * good as the open-coded solution below, (which is "HACKMEM 169"). */ -static HB_UNUSED inline unsigned int +static inline unsigned int _hb_popcount32 (uint32_t mask) { #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) @@ -240,7 +240,7 @@ typedef int hb_mutex_t; #define HB_DEBUG 0 #endif -static HB_UNUSED inline hb_bool_t /* always returns TRUE */ +static inline hb_bool_t /* always returns TRUE */ _hb_trace (const char *what, const char *function, const void *obj,