Convert "static const hb_tag_t" constants to enum

This commit is contained in:
Behdad Esfahbod 2018-11-29 15:04:34 -05:00
parent 9e4138c825
commit 5c4fead734
37 changed files with 53 additions and 53 deletions

View File

@ -58,7 +58,7 @@ typedef LArrayOf<Anchor> GlyphAnchors;
struct ankr
{
static const hb_tag_t tableTag = HB_AAT_TAG_ankr;
enum { tableTag = HB_AAT_TAG_ankr };
inline const Anchor &get_anchor (hb_codepoint_t glyph_id,
unsigned int i,

View File

@ -116,7 +116,7 @@ struct BaselineTableFormat3Part
struct bsln
{
static const hb_tag_t tableTag = HB_AAT_TAG_bsln;
enum { tableTag = HB_AAT_TAG_bsln };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -155,7 +155,7 @@ struct FeatureName
struct feat
{
static const hb_tag_t tableTag = HB_AAT_TAG_feat;
enum { tableTag = HB_AAT_TAG_feat };
inline bool has_data (void) const { return version.to_int (); }

View File

@ -382,7 +382,7 @@ struct JustificationHeader
struct just
{
static const hb_tag_t tableTag = HB_AAT_TAG_just;
enum { tableTag = HB_AAT_TAG_just };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -982,7 +982,7 @@ struct kerx : KerxTable<kerx>
{
friend struct KerxTable<kerx>;
static const hb_tag_t tableTag = HB_AAT_TAG_kerx;
enum { tableTag = HB_AAT_TAG_kerx };
enum { minVersion = 2u };
typedef KerxSubTableHeader SubTableHeader;

View File

@ -40,7 +40,7 @@ typedef ArrayOf<HBINT16> LigCaretClassEntry;
struct lcar
{
static const hb_tag_t tableTag = HB_AAT_TAG_lcar;
enum { tableTag = HB_AAT_TAG_lcar };
inline unsigned int get_lig_carets (hb_font_t *font,
hb_direction_t direction,

View File

@ -1096,7 +1096,7 @@ struct Chain
template <typename Types>
struct mortmorx
{
static const hb_tag_t tableTag = HB_AAT_TAG_morx;
enum { tableTag = HB_AAT_TAG_morx };
inline bool has_data (void) const { return version != 0; }
@ -1158,11 +1158,11 @@ struct mortmorx
struct morx : mortmorx<ExtendedTypes>
{
static const hb_tag_t tableTag = HB_AAT_TAG_morx;
enum { tableTag = HB_AAT_TAG_morx };
};
struct mort : mortmorx<ObsoleteTypes>
{
static const hb_tag_t tableTag = HB_AAT_TAG_mort;
enum { tableTag = HB_AAT_TAG_mort };
};

View File

@ -166,7 +166,7 @@ struct TrackData
struct trak
{
static const hb_tag_t tableTag = HB_AAT_TAG_trak;
enum { tableTag = HB_AAT_TAG_trak };
inline bool has_data (void) const { return version.to_int (); }

View File

@ -60,7 +60,7 @@ struct FTStringRange
struct ltag
{
static const hb_tag_t tableTag = HB_AAT_TAG_ltag;
enum { tableTag = HB_AAT_TAG_ltag };
inline hb_language_t get_language (unsigned int i) const
{

View File

@ -843,7 +843,7 @@ struct EncodingRecord
struct cmap
{
static const hb_tag_t tableTag = HB_OT_TAG_cmap;
enum { tableTag = HB_OT_TAG_cmap };
struct subset_plan
{

View File

@ -332,7 +332,7 @@ struct CBLC
{
friend struct CBDT;
static const hb_tag_t tableTag = HB_OT_TAG_CBLC;
enum { tableTag = HB_OT_TAG_CBLC };
inline bool sanitize (hb_sanitize_context_t *c) const
{
@ -378,7 +378,7 @@ struct CBLC
struct CBDT
{
static const hb_tag_t tableTag = HB_OT_TAG_CBDT;
enum { tableTag = HB_OT_TAG_CBDT };
struct accelerator_t
{

View File

@ -87,7 +87,7 @@ struct BaseGlyphRecord
struct COLR
{
static const hb_tag_t tableTag = HB_OT_TAG_COLR;
enum { tableTag = HB_OT_TAG_COLR };
inline bool has_data (void) const { return numBaseGlyphs; }

View File

@ -110,7 +110,7 @@ typedef HBUINT32 BGRAColor;
struct CPAL
{
static const hb_tag_t tableTag = HB_OT_TAG_CPAL;
enum { tableTag = HB_OT_TAG_CPAL };
inline bool has_data (void) const { return numPalettes; }

View File

@ -130,7 +130,7 @@ struct SBIXStrike
struct sbix
{
static const hb_tag_t tableTag = HB_OT_TAG_sbix;
enum { tableTag = HB_OT_TAG_sbix };
inline bool has_data (void) const { return version; }

View File

@ -73,7 +73,7 @@ struct SVGDocumentIndexEntry
struct SVG
{
static const hb_tag_t tableTag = HB_OT_TAG_SVG;
enum { tableTag = HB_OT_TAG_SVG };
inline bool has_data (void) const { return svgDocEntries; }

View File

@ -45,7 +45,7 @@ struct loca
{
friend struct glyf;
static const hb_tag_t tableTag = HB_OT_TAG_loca;
enum { tableTag = HB_OT_TAG_loca };
inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const
{
@ -71,7 +71,7 @@ struct loca
struct glyf
{
static const hb_tag_t tableTag = HB_OT_TAG_glyf;
enum { tableTag = HB_OT_TAG_glyf };
inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const
{

View File

@ -123,7 +123,7 @@ struct DeviceRecord
struct hdmx
{
static const hb_tag_t tableTag = HB_OT_TAG_hdmx;
enum { tableTag = HB_OT_TAG_hdmx };
inline unsigned int get_size (void) const
{

View File

@ -45,7 +45,7 @@ struct head
{
friend struct OffsetTable;
static const hb_tag_t tableTag = HB_OT_TAG_head;
enum { tableTag = HB_OT_TAG_head };
inline unsigned int get_upem (void) const
{

View File

@ -86,10 +86,10 @@ struct _hea
};
struct hhea : _hea<hhea> {
static const hb_tag_t tableTag = HB_OT_TAG_hhea;
enum { tableTag = HB_OT_TAG_hhea };
};
struct vhea : _hea<vhea> {
static const hb_tag_t tableTag = HB_OT_TAG_vhea;
enum { tableTag = HB_OT_TAG_vhea };
};

View File

@ -192,7 +192,7 @@ struct hmtxvmtx
default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face);
bool got_font_extents = false;
if (T::os2Tag)
if (T::os2Tag != HB_TAG_NONE)
{
#define USE_TYPO_METRICS (1u<<7)
if (0 != (face->table.OS2->fsSelection & USE_TYPO_METRICS))
@ -327,14 +327,14 @@ struct hmtxvmtx
};
struct hmtx : hmtxvmtx<hmtx, hhea> {
static const hb_tag_t tableTag = HB_OT_TAG_hmtx;
static const hb_tag_t variationsTag = HB_OT_TAG_HVAR;
static const hb_tag_t os2Tag = HB_OT_TAG_OS2;
enum { tableTag = HB_OT_TAG_hmtx };
enum { variationsTag = HB_OT_TAG_HVAR };
enum { os2Tag = HB_OT_TAG_OS2 };
};
struct vmtx : hmtxvmtx<vmtx, vhea> {
static const hb_tag_t tableTag = HB_OT_TAG_vmtx;
static const hb_tag_t variationsTag = HB_OT_TAG_VVAR;
static const hb_tag_t os2Tag = HB_TAG_NONE;
enum { tableTag = HB_OT_TAG_vmtx };
enum { variationsTag = HB_OT_TAG_VVAR };
enum { os2Tag = HB_TAG_NONE };
};
struct hmtx_accelerator_t : hmtx::accelerator_t {};

View File

@ -197,7 +197,7 @@ struct KernOT : AAT::KerxTable<KernOT>
{
friend struct AAT::KerxTable<KernOT>;
static const hb_tag_t tableTag = HB_OT_TAG_kern;
enum { tableTag = HB_OT_TAG_kern };
enum { minVersion = 0u };
typedef KernOTSubTableHeader SubTableHeader;
@ -252,7 +252,7 @@ struct KernAAT : AAT::KerxTable<KernAAT>
{
friend struct AAT::KerxTable<KernAAT>;
static const hb_tag_t tableTag = HB_OT_TAG_kern;
enum { tableTag = HB_OT_TAG_kern };
enum { minVersion = 0x00010000u };
typedef KernAATSubTableHeader SubTableHeader;
@ -269,7 +269,7 @@ struct KernAAT : AAT::KerxTable<KernAAT>
struct kern
{
static const hb_tag_t tableTag = HB_OT_TAG_kern;
enum { tableTag = HB_OT_TAG_kern };
inline bool has_data (void) const { return u.version32; }
inline unsigned int get_type (void) const { return u.major; }

View File

@ -465,7 +465,7 @@ struct Axis
struct BASE
{
static const hb_tag_t tableTag = HB_OT_TAG_BASE;
enum { tableTag = HB_OT_TAG_BASE };
inline const Axis &get_axis (hb_direction_t direction) const
{ return HB_DIRECTION_IS_VERTICAL (direction) ? this+vAxis : this+hAxis; }

View File

@ -340,7 +340,7 @@ struct MarkGlyphSets
struct GDEF
{
static const hb_tag_t tableTag = HB_OT_TAG_GDEF;
enum { tableTag = HB_OT_TAG_GDEF };
enum GlyphClasses {
UnclassifiedGlyph = 0,

View File

@ -1628,7 +1628,7 @@ struct PosLookup : Lookup
struct GPOS : GSUBGPOS
{
static const hb_tag_t tableTag = HB_OT_TAG_GPOS;
enum { tableTag = HB_OT_TAG_GPOS };
inline const PosLookup& get_lookup (unsigned int i) const
{ return CastR<PosLookup> (GSUBGPOS::get_lookup (i)); }

View File

@ -1475,7 +1475,7 @@ struct SubstLookup : Lookup
struct GSUB : GSUBGPOS
{
static const hb_tag_t tableTag = HB_OT_TAG_GSUB;
enum { tableTag = HB_OT_TAG_GSUB };
inline const SubstLookup& get_lookup (unsigned int i) const
{ return CastR<SubstLookup> (GSUBGPOS::get_lookup (i)); }

View File

@ -195,7 +195,7 @@ struct JstfScript
struct JSTF
{
static const hb_tag_t tableTag = HB_OT_TAG_JSTF;
enum { tableTag = HB_OT_TAG_JSTF };
inline unsigned int get_script_count (void) const
{ return scriptList.len; }

View File

@ -680,7 +680,7 @@ struct MathVariants
struct MATH
{
static const hb_tag_t tableTag = HB_OT_TAG_MATH;
enum { tableTag = HB_OT_TAG_MATH };
inline bool has_data (void) const { return version.to_int (); }

View File

@ -71,7 +71,7 @@ struct maxpV1Tail
struct maxp
{
static const hb_tag_t tableTag = HB_OT_TAG_maxp;
enum { tableTag = HB_OT_TAG_maxp };
inline unsigned int get_num_glyphs (void) const
{

View File

@ -151,7 +151,7 @@ _hb_ot_name_entry_cmp (const void *pa, const void *pb)
struct name
{
static const hb_tag_t tableTag = HB_OT_TAG_name;
enum { tableTag = HB_OT_TAG_name };
inline unsigned int get_size (void) const
{ return min_size + count * nameRecordZ[0].min_size; }

View File

@ -40,7 +40,7 @@ namespace OT {
struct OS2
{
static const hb_tag_t tableTag = HB_OT_TAG_OS2;
enum { tableTag = HB_OT_TAG_OS2 };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -71,7 +71,7 @@ struct postV2Tail
struct post
{
static const hb_tag_t tableTag = HB_OT_TAG_post;
enum { tableTag = HB_OT_TAG_post };
inline bool subset (hb_subset_plan_t *plan) const
{

View File

@ -225,7 +225,7 @@ struct AxisValue
struct STAT
{
static const hb_tag_t tableTag = HB_OT_TAG_STAT;
enum { tableTag = HB_OT_TAG_STAT };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -99,7 +99,7 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
struct avar
{
static const hb_tag_t tableTag = HB_OT_TAG_avar;
enum { tableTag = HB_OT_TAG_avar };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -96,7 +96,7 @@ struct AxisRecord
struct fvar
{
static const hb_tag_t tableTag = HB_OT_TAG_fvar;
enum { tableTag = HB_OT_TAG_fvar };
inline bool has_data (void) const { return version.to_int (); }

View File

@ -102,8 +102,8 @@ struct DeltaSetIndexMap
struct HVARVVAR
{
static const hb_tag_t HVARTag = HB_OT_TAG_HVAR;
static const hb_tag_t VVARTag = HB_OT_TAG_VVAR;
enum { HVARTag = HB_OT_TAG_HVAR };
enum { VVARTag = HB_OT_TAG_VVAR };
inline bool sanitize (hb_sanitize_context_t *c) const
{
@ -143,10 +143,10 @@ struct HVARVVAR
};
struct HVAR : HVARVVAR {
static const hb_tag_t tableTag = HB_OT_TAG_HVAR;
enum { tableTag = HB_OT_TAG_HVAR };
};
struct VVAR : HVARVVAR {
static const hb_tag_t tableTag = HB_OT_TAG_VVAR;
enum { tableTag = HB_OT_TAG_VVAR };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -58,7 +58,7 @@ struct VariationValueRecord
struct MVAR
{
static const hb_tag_t tableTag = HB_OT_TAG_MVAR;
enum { tableTag = HB_OT_TAG_MVAR };
inline bool sanitize (hb_sanitize_context_t *c) const
{

View File

@ -57,7 +57,7 @@ struct VertOriginMetric
struct VORG
{
static const hb_tag_t tableTag = HB_OT_TAG_VORG;
enum { tableTag = HB_OT_TAG_VORG };
inline bool has_data (void) const { return version.to_int (); }