[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Apr 5 08:22:13 UTC 2018
src/Makefile.sources | 2 -
src/hb-aat-layout-feat-table.hh | 48 +++++++++++++++++++---------------------
src/hb-aat-layout.cc | 2 -
3 files changed, 25 insertions(+), 27 deletions(-)
New commits:
commit d3984b45b5d110f34febbb9e1d8a9c2203080a1b
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date: Sun Apr 1 12:16:42 2018 +0430
[aat] Further improvements on feat (#948)
diff --git a/src/Makefile.sources b/src/Makefile.sources
index dc105e58..1ed64fec 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -83,11 +83,11 @@ HB_OT_sources = \
hb-aat-layout-common-private.hh \
hb-aat-layout-ankr-table.hh \
hb-aat-layout-bsln-table.hh \
+ hb-aat-layout-feat-table.hh \
hb-aat-layout-kerx-table.hh \
hb-aat-layout-morx-table.hh \
hb-aat-layout-trak-table.hh \
hb-aat-layout-private.hh \
- hb-aat-feat-table.hh \
hb-aat-fmtx-table.hh \
hb-aat-gcid-table.hh \
hb-aat-ltag-table.hh \
diff --git a/src/hb-aat-feat-table.hh b/src/hb-aat-layout-feat-table.hh
similarity index 81%
rename from src/hb-aat-feat-table.hh
rename to src/hb-aat-layout-feat-table.hh
index 15f9060e..63355470 100644
--- a/src/hb-aat-feat-table.hh
+++ b/src/hb-aat-layout-feat-table.hh
@@ -22,8 +22,8 @@
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
-#ifndef HB_AAT_FEAT_TABLE_HH
-#define HB_AAT_FEAT_TABLE_HH
+#ifndef HB_AAT_LAYOUT_FEAT_TABLE_HH
+#define HB_AAT_LAYOUT_FEAT_TABLE_HH
#include "hb-aat-layout-common-private.hh"
@@ -32,13 +32,28 @@
namespace AAT {
-struct FeatureName {
+struct SettingName
+{
+ inline bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ return_trace (c->check_struct (this));
+ }
+ protected:
+ HBUINT16 setting; /* The setting. */
+ NameID nameIndex; /* The name table index for the setting's name. */
+ public:
+ DEFINE_SIZE_STATIC (4);
+};
+
+struct FeatureName
+{
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
- (base+settingTable).sanitize (c, nSettings, base));
+ (base+settingTable).sanitize (c, nSettings));
}
enum {
@@ -55,28 +70,11 @@ struct FeatureName {
* as the default. */
};
- struct SettingName
- {
- inline bool sanitize (hb_sanitize_context_t *c, const void *base HB_UNUSED) const
- {
- TRACE_SANITIZE (this);
- return_trace (c->check_struct (this) &&
- nameIndex > 255 && nameIndex < 32768);
- }
-
- protected:
- HBUINT16 setting; /* The setting. */
- NameID nameIndex; /* The name table index for the setting's name.
- * The nameIndex must be greater than 255 and less than 32768. */
- public:
- DEFINE_SIZE_STATIC (4);
- };
-
protected:
HBUINT16 feature; /* Feature type. */
HBUINT16 nSettings; /* The number of records in the setting name array. */
LOffsetTo<UnsizedArrayOf<SettingName> >
- settingTable; /* Offset in bytes from the beginning of this table to
+ settingTable; /* Offset in bytes from the beginning of this table to
* this feature's setting name array. The actual type of
* record this offset refers to will depend on the
* exclusivity value, as described below. */
@@ -90,7 +88,7 @@ struct FeatureName {
/*
* feat -- Feature name
- * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fmtx.html
+ * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6feat.html
*/
struct feat
@@ -101,7 +99,7 @@ struct feat
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
- names.sanitize (c, featureNameCount, this));
+ names.sanitize (c, featureNameCount, this));
}
protected:
@@ -119,4 +117,4 @@ struct feat
} /* namespace AAT */
-#endif /* HB_AAT_FEAT_TABLE_HH */
+#endif /* HB_AAT_LAYOUT_FEAT_TABLE_HH */
diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index c55b9b68..ad858495 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -32,10 +32,10 @@
#include "hb-aat-layout-private.hh"
#include "hb-aat-layout-ankr-table.hh"
#include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise.
+#include "hb-aat-layout-feat-table.hh" // Just so we compile it; unused otherwise.
#include "hb-aat-layout-kerx-table.hh"
#include "hb-aat-layout-morx-table.hh"
#include "hb-aat-layout-trak-table.hh"
-#include "hb-aat-feat-table.hh" // Just so we compile it; unused otherwise.
#include "hb-aat-fmtx-table.hh" // Just so we compile it; unused otherwise.
#include "hb-aat-gcid-table.hh" // Just so we compile it; unused otherwise.
#include "hb-aat-ltag-table.hh" // Just so we compile it; unused otherwise.
More information about the HarfBuzz
mailing list