Imported Upstream version 2.3.1
[platform/upstream/harfbuzz.git] / src / hb-ot-head-table.hh
index 965e30a..3c0bb3d 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef HB_OT_HEAD_TABLE_HH
 #define HB_OT_HEAD_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * head -- Font Header
@@ -45,16 +45,29 @@ struct head
 {
   friend struct OffsetTable;
 
-  static const hb_tag_t tableTag       = HB_OT_TAG_head;
+  static constexpr hb_tag_t tableTag = HB_OT_TAG_head;
 
-  inline unsigned int get_upem (void) const
+  unsigned int get_upem () const
   {
     unsigned int upem = unitsPerEm;
     /* If no valid head table found, assume 1000, which matches typical Type1 usage. */
     return 16 <= upem && upem <= 16384 ? upem : 1000;
   }
 
-  inline bool sanitize (hb_sanitize_context_t *c) const
+  enum mac_style_flag_t {
+    BOLD       = 1u<<0,
+    ITALIC     = 1u<<1,
+    UNDERLINE  = 1u<<2,
+    OUTLINE    = 1u<<3,
+    SHADOW     = 1u<<4,
+    CONDENSED  = 1u<<5
+  };
+
+  bool is_bold () const      { return macStyle & BOLD; }
+  bool is_italic () const    { return macStyle & ITALIC; }
+  bool is_condensed () const { return macStyle & CONDENSED; }
+
+  bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
@@ -141,8 +154,8 @@ struct head
                                         * -1: Only strongly right to left;
                                         * -2: Like -1 but also contains neutrals. */
   public:
-  HBINT16      indexToLocFormat;       /* 0 for short offsets, 1 for long. */
-  HBINT16      glyphDataFormat;        /* 0 for current format. */
+  HBUINT16     indexToLocFormat;       /* 0 for short offsets, 1 for long. */
+  HBUINT16     glyphDataFormat;        /* 0 for current format. */
 
   DEFINE_SIZE_STATIC (54);
 };