[HarfBuzz] harfbuzz: Branch 'master' - 4 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Jan 23 04:33:14 UTC 2017


 docs/harfbuzz-sections.txt           |    2 --
 src/hb-open-file-private.hh          |    2 +-
 src/hb-open-type-private.hh          |    2 ++
 src/hb-ot-cbdt-table.hh              |    8 ++++----
 src/hb-ot-cmap-table.hh              |    6 +++---
 src/hb-ot-font.cc                    |    6 +++---
 src/hb-ot-hmtx-table.hh              |    8 +++-----
 src/hb-ot-layout-common-private.hh   |   12 ++++++------
 src/hb-ot-layout-gdef-table.hh       |    4 ++--
 src/hb-ot-layout-gsubgpos-private.hh |    2 +-
 src/hb-ot-var-avar-table.hh          |    2 ++
 src/hb-ot-var-fvar-table.hh          |    2 ++
 src/hb-ot-var.h                      |    3 ---
 13 files changed, 29 insertions(+), 30 deletions(-)

New commits:
commit b732c53eb5bd0c2cc86f35a9d9623c92579a0b8c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Jan 22 20:31:53 2017 -0800

    Add LArrayOf<>

diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 8bd3618..d90d68c 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -952,6 +952,7 @@ struct ArrayOf
   public:
   DEFINE_SIZE_ARRAY (sizeof (LenType), array);
 };
+template <typename Type> struct LArrayOf : ArrayOf<Type, ULONG> {};
 
 /* Array of Offset's */
 template <typename Type, typename OffsetType=USHORT>
diff --git a/src/hb-ot-cbdt-table.hh b/src/hb-ot-cbdt-table.hh
index 93cf0e8..0a7fbf5 100644
--- a/src/hb-ot-cbdt-table.hh
+++ b/src/hb-ot-cbdt-table.hh
@@ -348,8 +348,8 @@ struct CBLC
   }
 
   protected:
-  FixedVersion<>version;
-  ArrayOf<BitmapSizeTable, ULONG> sizeTables;
+  FixedVersion<>		version;
+  LArrayOf<BitmapSizeTable>	sizeTables;
 
   public:
   DEFINE_SIZE_ARRAY(8, sizeTables);
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 2f83497..92b5c17 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -1527,7 +1527,7 @@ struct FeatureVariations
 
   protected:
   FixedVersion<>	version;	/* Version--0x00010000u */
-  ArrayOf<FeatureVariationRecord, ULONG>
+  LArrayOf<FeatureVariationRecord>
 			varRecords;
   public:
   DEFINE_SIZE_ARRAY (8, varRecords);
commit 5e156fa5ed33cd1a8ff388833563f15930bb12f9
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Jan 22 20:28:56 2017 -0800

    Add LOffsetTo<>

diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh
index 5357ddc..f208419 100644
--- a/src/hb-open-file-private.hh
+++ b/src/hb-open-file-private.hh
@@ -142,7 +142,7 @@ struct TTCHeaderVersion1
   Tag		ttcTag;		/* TrueType Collection ID string: 'ttcf' */
   FixedVersion<>version;	/* Version of the TTC Header (1.0),
 				 * 0x00010000u */
-  ArrayOf<OffsetTo<OffsetTable, ULONG>, ULONG>
+  ArrayOf<LOffsetTo<OffsetTable>, ULONG>
 		table;		/* Array of offsets to the OffsetTable for each font
 				 * from the beginning of the file */
   public:
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 8845e3e..8bd3618 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -830,6 +830,7 @@ struct OffsetTo : Offset<OffsetType>
   }
   DEFINE_SIZE_STATIC (sizeof(OffsetType));
 };
+template <typename Type> struct LOffsetTo : OffsetTo<Type, ULONG> {};
 template <typename Base, typename OffsetType, typename Type>
 static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType> &offset) { return offset (base); }
 template <typename Base, typename OffsetType, typename Type>
diff --git a/src/hb-ot-cbdt-table.hh b/src/hb-ot-cbdt-table.hh
index 52897ab..93cf0e8 100644
--- a/src/hb-ot-cbdt-table.hh
+++ b/src/hb-ot-cbdt-table.hh
@@ -216,7 +216,7 @@ struct IndexSubtableRecord
 
   USHORT firstGlyphIndex;
   USHORT lastGlyphIndex;
-  OffsetTo<IndexSubtable, ULONG> offsetToSubtable;
+  LOffsetTo<IndexSubtable> offsetToSubtable;
 
   DEFINE_SIZE_STATIC(8);
 };
@@ -275,7 +275,7 @@ struct BitmapSizeTable
   }
 
   protected:
-  OffsetTo<IndexSubtableArray, ULONG> indexSubtableArrayOffset;
+  LOffsetTo<IndexSubtableArray> indexSubtableArrayOffset;
   ULONG indexTablesSize;
   ULONG numberOfIndexSubtables;
   ULONG colorRef;
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index d7a94a1..3a53a1c 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -380,9 +380,9 @@ struct VariationSelectorRecord
   }
 
   UINT24	varSelector;	/* Variation selector. */
-  OffsetTo<DefaultUVS, ULONG>
+  LOffsetTo<DefaultUVS>
 		defaultUVS;	/* Offset to Default UVS Table. May be 0. */
-  OffsetTo<NonDefaultUVS, ULONG>
+  LOffsetTo<NonDefaultUVS>
 		nonDefaultUVS;	/* Offset to Non-Default UVS Table. May be 0. */
   public:
   DEFINE_SIZE_STATIC (11);
@@ -486,7 +486,7 @@ struct EncodingRecord
 
   USHORT	platformID;	/* Platform ID. */
   USHORT	encodingID;	/* Platform-specific encoding ID. */
-  OffsetTo<CmapSubtable, ULONG>
+  LOffsetTo<CmapSubtable>
 		subtable;	/* Byte offset from beginning of table to the subtable for this encoding. */
   public:
   DEFINE_SIZE_STATIC (8);
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 62ca7a3..2f83497 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -1334,7 +1334,7 @@ struct VariationStore
 
   protected:
   USHORT				format;
-  OffsetTo<VarRegionList, ULONG>	regions;
+  LOffsetTo<VarRegionList>		regions;
   OffsetArrayOf<VarData, ULONG>		dataSets;
   public:
   DEFINE_SIZE_ARRAY (8, dataSets);
@@ -1433,8 +1433,8 @@ struct FeatureTableSubstitutionRecord
   }
 
   protected:
-  USHORT			featureIndex;
-  OffsetTo<Feature, ULONG>	feature;
+  USHORT		featureIndex;
+  LOffsetTo<Feature>	feature;
   public:
   DEFINE_SIZE_STATIC (6);
 };
@@ -1481,9 +1481,9 @@ struct FeatureVariationRecord
   }
 
   protected:
-  OffsetTo<ConditionSet, ULONG>
+  LOffsetTo<ConditionSet>
 			conditions;
-  OffsetTo<FeatureTableSubstitution, ULONG>
+  LOffsetTo<FeatureTableSubstitution>
 			substitutions;
   public:
   DEFINE_SIZE_STATIC (8);
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index b70cbb7..552df0f 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -295,7 +295,7 @@ struct MarkGlyphSetsFormat1
 
   protected:
   USHORT	format;			/* Format identifier--format = 1 */
-  ArrayOf<OffsetTo<Coverage, ULONG> >
+  ArrayOf<LOffsetTo<Coverage> >
 		coverage;		/* Array of long offsets to mark set
 					 * coverage tables */
   public:
@@ -443,7 +443,7 @@ struct GDEF
 					 * definitions--from beginning of GDEF
 					 * header (may be NULL).  Introduced
 					 * in version 0x00010002. */
-  OffsetTo<VariationStore, ULONG>
+  LOffsetTo<VariationStore>
 		varStore;		/* Offset to the table of Item Variation
 					 * Store--from beginning of GDEF
 					 * header (may be NULL).  Introduced
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index fd75c54..b7a0122 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -2313,7 +2313,7 @@ struct GSUBGPOS
 		featureList; 	/* FeatureList table */
   OffsetTo<LookupList>
 		lookupList; 	/* LookupList table */
-  OffsetTo<FeatureVariations, ULONG>
+  LOffsetTo<FeatureVariations>
 		featureVars;	/* Offset to Feature Variations
 				   table--from beginning of table
 				 * (may be NULL).  Introduced
commit d6bdbbca307d1a4aed60a78133eea40a1a9d5bf3
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Jan 22 20:16:51 2017 -0800

    [var] Remove HB_OT_TAG_fvar/avar
    
    We're not going to define public macros for tags for tables.
    There's little use to those and they are implementation detail.

diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt
index 3011ee9..a91eb4c 100644
--- a/docs/harfbuzz-sections.txt
+++ b/docs/harfbuzz-sections.txt
@@ -440,8 +440,6 @@ Xhb_ot_layout_lookup_substitute
 
 <SECTION>
 <FILE>hb-ot-var</FILE>
-HB_OT_TAG_avar
-HB_OT_TAG_fvar
 HB_OT_TAG_VAR_AXIS_ITALIC
 HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE
 HB_OT_TAG_VAR_AXIS_SLANT
diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh
index 743d587..7c8449a 100644
--- a/src/hb-ot-var-avar-table.hh
+++ b/src/hb-ot-var-avar-table.hh
@@ -88,6 +88,8 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
  * avar — Axis Variations Table
  */
 
+#define HB_OT_TAG_avar HB_TAG('a','v','a','r')
+
 struct avar
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_avar;
diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh
index cb88de8..0c48769 100644
--- a/src/hb-ot-var-fvar-table.hh
+++ b/src/hb-ot-var-fvar-table.hh
@@ -81,6 +81,8 @@ struct AxisRecord
  * fvar — Font Variations Table
  */
 
+#define HB_OT_TAG_fvar HB_TAG('f','v','a','r')
+
 struct fvar
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_fvar;
diff --git a/src/hb-ot-var.h b/src/hb-ot-var.h
index ea69aa5..a2c0c5f 100644
--- a/src/hb-ot-var.h
+++ b/src/hb-ot-var.h
@@ -36,9 +36,6 @@
 HB_BEGIN_DECLS
 
 
-#define HB_OT_TAG_fvar HB_TAG('f','v','a','r')
-#define HB_OT_TAG_avar HB_TAG('a','v','a','r')
-
 #define HB_OT_TAG_VAR_AXIS_ITALIC	HB_TAG('i','t','a','l')
 #define HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE	HB_TAG('o','p','s','z')
 #define HB_OT_TAG_VAR_AXIS_SLANT	HB_TAG('s','l','n','t')
commit a11d9a0466e480efebd69a34827675387cd2ca34
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Jan 22 20:09:47 2017 -0800

    Minor

diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index c4ec612..f84dbc2 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -50,7 +50,7 @@ struct hb_ot_face_metrics_accelerator_t
   unsigned short line_gap;
   bool has_font_extents;
 
-  const OT::_mtx *table;
+  const OT::hmtxvmtx *table;
   hb_blob_t *blob;
 
   inline void init (hb_face_t *face,
@@ -91,7 +91,7 @@ struct hb_ot_face_metrics_accelerator_t
 
     this->has_font_extents = got_font_extents;
 
-    this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
+    this->blob = OT::Sanitizer<OT::hmtxvmtx>::sanitize (face->reference_table (_mtx_tag));
 
     /* Cap num_metrics() and num_advances() based on table length. */
     unsigned int len = hb_blob_get_length (this->blob);
@@ -107,7 +107,7 @@ struct hb_ot_face_metrics_accelerator_t
       hb_blob_destroy (this->blob);
       this->blob = hb_blob_get_empty ();
     }
-    this->table = OT::Sanitizer<OT::_mtx>::lock_instance (this->blob);
+    this->table = OT::Sanitizer<OT::hmtxvmtx>::lock_instance (this->blob);
   }
 
   inline void fini (void)
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index a9606b3..30aa625 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -50,10 +50,8 @@ struct LongMetric
   DEFINE_SIZE_STATIC (4);
 };
 
-struct _mtx
+struct hmtxvmtx
 {
-  static const hb_tag_t tableTag = HB_TAG('_','m','t','x');
-
   static const hb_tag_t hmtxTag	= HB_OT_TAG_hmtx;
   static const hb_tag_t vmtxTag	= HB_OT_TAG_vmtx;
 
@@ -91,10 +89,10 @@ struct _mtx
   DEFINE_SIZE_ARRAY2 (0, longMetric, leadingBearingX);
 };
 
-struct hmtx : _mtx {
+struct hmtx : hmtxvmtx {
   static const hb_tag_t tableTag	= HB_OT_TAG_hmtx;
 };
-struct vmtx : _mtx {
+struct vmtx : hmtxvmtx {
   static const hb_tag_t tableTag	= HB_OT_TAG_vmtx;
 };
 


More information about the HarfBuzz mailing list