*/
struct AttachPoint {
+
+ friend struct AttachList;
+
+ private:
/* countour point indices, in increasing numerical order */
DEFINE_ARRAY_TYPE (USHORT, pointIndex, pointCount);
DEFINE_NULL_ASSERT_SIZE (AttachPoint, 2);
struct AttachList {
+
+ friend struct GDEF;
+
+ private:
/* const AttachPoint& get_attach_points (uint16_t glyph_id); */
DEFINE_INDIRECT_GLYPH_ARRAY_LOOKUP (AttachPoint, get_attach_points);
struct CaretValueFormat1 {
+ friend struct CaretValue;
+
+ private:
inline int get_caret_value (int ppem) const {
return /* TODO garbage */ coordinate / ppem;
}
struct CaretValueFormat2 {
+ friend struct CaretValue;
+
+ private:
inline int get_caret_value (int ppem) const {
return /* TODO garbage */ 0 / ppem;
}
struct CaretValueFormat3 {
+ friend struct CaretValue;
+
+ private:
inline const Device& get_device (void) const {
if (HB_UNLIKELY (!deviceTable)) return NullDevice;
return *(const Device*)((const char*)this + deviceTable);
struct CaretValue {
DEFINE_NON_INSTANTIABLE(CaretValue);
- inline unsigned int get_size (void) const {
+ unsigned int get_size (void) const {
switch (u.caretValueFormat) {
case 1: return sizeof (u.format1);
case 2: return sizeof (u.format2);
}
/* XXX we need access to a load-contour-point vfunc here */
- inline int get_caret_value (int ppem) const {
+ int get_caret_value (int ppem) const {
switch (u.caretValueFormat) {
case 1: return u.format1.get_caret_value(ppem);
case 2: return u.format2.get_caret_value(ppem);
DEFINE_NULL (CaretValue, 2);
struct LigGlyph {
+
+ friend struct LigCaretList;
+
+ private:
/* Caret value tables, in increasing coordinate order */
DEFINE_OFFSET_ARRAY_TYPE (CaretValue, caretValue, caretCount);
/* TODO */
DEFINE_NULL_ASSERT_SIZE (LigGlyph, 2);
struct LigCaretList {
+
+ friend struct GDEF;
+
+ private:
/* const LigGlyph& get_lig_glyph (uint16_t glyph_id); */
DEFINE_INDIRECT_GLYPH_ARRAY_LOOKUP (LigGlyph, get_lig_glyph);
*/
struct GDEF {
- static const hb_tag_t GDEFTag = HB_TAG ('G','D','E','F');
+ static const hb_tag_t Tag = HB_TAG ('G','D','E','F');
STATIC_DEFINE_GET_FOR_DATA (GDEF);
/* XXX check version here? */
/* Returns 0 if not found. */
inline int get_glyph_class (uint16_t glyph_id) const {
- const ClassDef &class_def = get_glyph_class_def ();
- return class_def.get_class (glyph_id);
+ return get_glyph_class_def ().get_class (glyph_id);
}
/* Returns 0 if not found. */
inline int get_mark_attachment_type (uint16_t glyph_id) const {
- const ClassDef &class_def = get_mark_attach_class_def ();
- return class_def.get_class (glyph_id);
+ return get_mark_attach_class_def ().get_class (glyph_id);
}
/* TODO get_glyph_property */
DEFINE_NULL_ASSERT_SIZE (TableDirectory, 16);
typedef struct OffsetTable {
+
+ friend struct OpenTypeFontFile;
+ friend struct TTCHeader;
+
+ // XXX private:
+ // Add get_num_tables and get_table...
/* OpenTypeTables, in no particular order */
DEFINE_ARRAY_TYPE (TableDirectory, tableDir, numTables);
// TODO: Implement find_table
*/
struct TTCHeader {
+
+ friend struct OpenTypeFontFile;
+
+ private:
/* OpenTypeFontFaces, in no particular order */
DEFINE_OFFSET_ARRAY_TYPE (OffsetTable, offsetTable, numFonts);
/* XXX check version here? */
}
/* Array interface sans get_size() */
- inline unsigned int get_len (void) const {
+ unsigned int get_len (void) const {
switch (tag) {
default: return 0;
case TrueTypeTag: case CFFTag: return 1;
case TTCTag: return ((const TTCHeader&)*this).get_len();
}
}
- inline const OpenTypeFontFace& operator[] (unsigned int i) const {
+ const OpenTypeFontFace& operator[] (unsigned int i) const {
if (HB_UNLIKELY (i >= get_len ())) return NullOpenTypeFontFace;
switch (tag) {
default: case TrueTypeTag: case CFFTag: return (const OffsetTable&)*this;
*/
struct CoverageFormat1 {
+
+ friend struct Coverage;
+
+ private:
/* GlyphIDs, in sorted numerical order */
DEFINE_ARRAY_TYPE (GlyphID, glyphArray, glyphCount);
struct CoverageRangeRecord {
+ friend struct CoverageFormat2;
+
+ private:
inline int get_coverage (uint16_t glyph_id) const {
if (glyph_id >= start && glyph_id <= end)
return startCoverageIndex + (glyph_id - start);
DEFINE_NULL_ASSERT_SIZE_DATA (CoverageRangeRecord, 6, "\001");
struct CoverageFormat2 {
+
+ friend struct Coverage;
+
+ private:
/* CoverageRangeRecords, in sorted numerical start order */
DEFINE_ARRAY_TYPE (CoverageRangeRecord, rangeRecord, rangeCount);
struct Coverage {
DEFINE_NON_INSTANTIABLE(Coverage);
- inline unsigned int get_size (void) const {
+ unsigned int get_size (void) const {
switch (u.coverageFormat) {
case 1: return u.format1.get_size ();
case 2: return u.format2.get_size ();
}
/* Returns -1 if not covered. */
- inline int get_coverage (uint16_t glyph_id) const {
+ int get_coverage (uint16_t glyph_id) const {
switch (u.coverageFormat) {
case 1: return u.format1.get_coverage(glyph_id);
case 2: return u.format2.get_coverage(glyph_id);
*/
struct ClassDefFormat1 {
+
+ friend struct ClassDef;
+
+ private:
/* GlyphIDs, in sorted numerical order */
DEFINE_ARRAY_TYPE (USHORT, classValueArray, glyphCount);
struct ClassRangeRecord {
+ friend struct ClassDefFormat2;
+
+ private:
inline int get_class (uint16_t glyph_id) const {
if (glyph_id >= start && glyph_id <= end)
return classValue;
DEFINE_NULL_ASSERT_SIZE_DATA (ClassRangeRecord, 6, "\001");
struct ClassDefFormat2 {
+
+ friend struct ClassDef;
+
+ private:
/* ClassRangeRecords, in sorted numerical start order */
DEFINE_ARRAY_TYPE (ClassRangeRecord, rangeRecord, rangeCount);
struct ClassDef {
DEFINE_NON_INSTANTIABLE(ClassDef);
- inline unsigned int get_size (void) const {
+ unsigned int get_size (void) const {
switch (u.classFormat) {
case 1: return u.format1.get_size ();
case 2: return u.format2.get_size ();
}
/* Returns 0 if not found. */
- inline int get_class (uint16_t glyph_id) const {
+ int get_class (uint16_t glyph_id) const {
switch (u.classFormat) {
case 1: return u.format1.get_class(glyph_id);
case 2: return u.format2.get_class(glyph_id);
*/
struct Device {
+ DEFINE_NON_INSTANTIABLE(Device);
- inline unsigned int get_size (void) const {
+ unsigned int get_size (void) const {
int count = endSize - startSize + 1;
if (count < 0) count = 0;
switch (deltaFormat) {
}
}
- inline int get_delta (int ppem_size) const {
+ int get_delta (int ppem_size) const {
if (ppem_size >= startSize && ppem_size <= endSize &&
deltaFormat >= 1 && deltaFormat <= 3) {
int s = ppem_size - startSize;