[glyf] Split loca.hh

This commit is contained in:
Behdad Esfahbod 2022-06-25 14:41:51 -06:00
parent 100576b7b7
commit 852985da0f
4 changed files with 46 additions and 28 deletions

View File

@ -89,6 +89,7 @@ HB_BASE_sources = \
hb-ot-layout-gpos-table.hh \ hb-ot-layout-gpos-table.hh \
hb-ot-layout-gsub-table.hh \ hb-ot-layout-gsub-table.hh \
OT/glyf/glyf.hh \ OT/glyf/glyf.hh \
OT/glyf/loca.hh \
OT/Layout/GSUB/Common.hh \ OT/Layout/GSUB/Common.hh \
OT/Layout/GSUB/Sequence.hh \ OT/Layout/GSUB/Sequence.hh \
OT/Layout/GSUB/SingleSubstFormat1.hh \ OT/Layout/GSUB/SingleSubstFormat1.hh \

View File

@ -8,43 +8,17 @@
#include "hb-ot-var-gvar-table.hh" #include "hb-ot-var-gvar-table.hh"
#include "hb-draw.hh" #include "hb-draw.hh"
#include "OT/glyf/loca.hh"
namespace OT { namespace OT {
/*
* loca -- Index to Location
* https://docs.microsoft.com/en-us/typography/opentype/spec/loca
*/
#define HB_OT_TAG_loca HB_TAG('l','o','c','a')
#ifndef HB_MAX_COMPOSITE_OPERATIONS #ifndef HB_MAX_COMPOSITE_OPERATIONS
#define HB_MAX_COMPOSITE_OPERATIONS 100000 #define HB_MAX_COMPOSITE_OPERATIONS 100000
#endif #endif
struct loca
{
friend struct glyf;
static constexpr hb_tag_t tableTag = HB_OT_TAG_loca;
bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const
{
TRACE_SANITIZE (this);
return_trace (true);
}
protected:
UnsizedArrayOf<HBUINT8>
dataZ; /* Location data. */
public:
DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always
* check the size externally, allow Null() object of it by
* defining it _MIN instead. */
};
/* /*
* glyf -- TrueType Glyph Data * glyf -- TrueType Glyph Data
* https://docs.microsoft.com/en-us/typography/opentype/spec/glyf * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf

42
src/OT/glyf/loca.hh Normal file
View File

@ -0,0 +1,42 @@
#ifndef OT_GLYF_LOCA_HH
#define OT_GLYF_LOCA_HH
#include "hb-open-type.hh"
namespace OT {
/*
* loca -- Index to Location
* https://docs.microsoft.com/en-us/typography/opentype/spec/loca
*/
#define HB_OT_TAG_loca HB_TAG('l','o','c','a')
struct loca
{
friend struct glyf;
static constexpr hb_tag_t tableTag = HB_OT_TAG_loca;
bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const
{
TRACE_SANITIZE (this);
return_trace (true);
}
protected:
UnsizedArrayOf<HBUINT8>
dataZ; /* Location data. */
public:
DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always
* check the size externally, allow Null() object of it by
* defining it _MIN instead. */
};
} /* namespace OT */
#endif /* OT_GLYF_LOCA_HH */

View File

@ -93,6 +93,7 @@ hb_base_sources = files(
'hb-ot-layout-gpos-table.hh', 'hb-ot-layout-gpos-table.hh',
'hb-ot-layout-gsub-table.hh', 'hb-ot-layout-gsub-table.hh',
'OT/glyf/glyf.hh', 'OT/glyf/glyf.hh',
'OT/glyf/loca.hh',
'OT/Layout/GSUB/Common.hh', 'OT/Layout/GSUB/Common.hh',
'OT/Layout/GSUB/Sequence.hh', 'OT/Layout/GSUB/Sequence.hh',
'OT/Layout/GSUB/SingleSubstFormat1.hh', 'OT/Layout/GSUB/SingleSubstFormat1.hh',