hb-ot-layout-gdef-table.hh revision 3d54bd1293069fc3d3bdeeea8ad45036f3ee65f3
164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod/* 264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Copyright (C) 2007,2008 Red Hat, Inc. 364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * 464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * This is part of HarfBuzz, an OpenType Layout engine library. 564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * 664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Permission is hereby granted, without written agreement and without 764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this 864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * software and its documentation for any purpose, provided that the 964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * above copyright notice and the following two paragraphs appear in 1064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * all copies of this software. 1164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * 1264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 1364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 1464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 1564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 1664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * DAMAGE. 1764aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * 1864aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 1964aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 2064aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 2164aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 2264aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 2364aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * 2464aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod * Red Hat Author(s): Behdad Esfahbod 2564aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod */ 2664aef3a54999496fd1de4f5aa5b019e4c03b3836Behdad Esfahbod 278dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#ifndef HB_OT_LAYOUT_GDEF_PRIVATE_H 288dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#define HB_OT_LAYOUT_GDEF_PRIVATE_H 295b3f7702a64fe0513d08a67bdb72704e46fd7cd4Behdad Esfahbod 30fd92a3dde32fd10df30c9eeb97641bc3c15b1e9bBehdad Esfahbod#include "hb-ot-layout-private.h" 31a16ecbf0564a6e2576da22c12827f3c0719da549Behdad Esfahbod 328dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#include "hb-ot-layout-open-private.h" 335b3f7702a64fe0513d08a67bdb72704e46fd7cd4Behdad Esfahbod 3412360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 3512360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod#define DEFINE_INDIRECT_GLYPH_ARRAY_LOOKUP(Type, name) \ 362d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod inline const Type& name (hb_codepoint_t glyph) { \ 373d54bd1293069fc3d3bdeeea8ad45036f3ee65f3Behdad Esfahbod return (*this)[(this+coverage)(glyph)]; \ 3812360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod } 3912360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 4012360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 414c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbodstruct GlyphClassDef : ClassDef { 422d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod static const unsigned int BaseGlyph = 0x0001u; 432d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod static const unsigned int LigatureGlyph = 0x0002u; 442d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod static const unsigned int MarkGlyph = 0x0003u; 452d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod static const unsigned int ComponentGlyph = 0x0004u; 464c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 474c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 481f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod/* 491f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * Attachment List Table 501f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod */ 514c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 521f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbodstruct AttachPoint { 537586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 547586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct AttachList; 557586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 567586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 571f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod /* countour point indices, in increasing numerical order */ 581f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod DEFINE_ARRAY_TYPE (USHORT, pointIndex, pointCount); 591f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod 601f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod private: 611f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod USHORT pointCount; /* Number of attachment points on 621f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * this glyph */ 631f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod USHORT pointIndex[]; /* Array of contour point indices--in 641f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * increasing numerical order */ 651f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod}; 668b8358033184198ff638ee1379093717596e162dBehdad EsfahbodASSERT_SIZE (AttachPoint, 2); 67303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 681f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbodstruct AttachList { 697586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 707586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct GDEF; 717586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 727586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 732d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod /* const AttachPoint& get_attach_points (hb_codepoint_t glyph); */ 7412360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod DEFINE_INDIRECT_GLYPH_ARRAY_LOOKUP (AttachPoint, get_attach_points); 75303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 761f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod private: 771f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod /* AttachPoint tables, in Coverage Index order */ 781f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod DEFINE_OFFSET_ARRAY_TYPE (AttachPoint, attachPoint, glyphCount); 794c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 8012360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod private: 813d54bd1293069fc3d3bdeeea8ad45036f3ee65f3Behdad Esfahbod OffsetTo<Coverage> 823d54bd1293069fc3d3bdeeea8ad45036f3ee65f3Behdad Esfahbod coverage; /* Offset to Coverage table -- from 834c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * beginning of AttachList table */ 844c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod USHORT glyphCount; /* Number of glyphs with attachment 854c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * points */ 864c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod Offset attachPoint[]; /* Array of offsets to AttachPoint 874c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * tables--from beginning of AttachList 884c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * table--in Coverage Index order */ 894c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 908b8358033184198ff638ee1379093717596e162dBehdad EsfahbodASSERT_SIZE (AttachList, 4); 914c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 924c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod/* 934c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * Ligature Caret Table 944c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod */ 954c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 964c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbodstruct CaretValueFormat1 { 974c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 987586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct CaretValue; 997586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1007586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 1014c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod inline int get_caret_value (int ppem) const { 102303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod return /* TODO garbage */ coordinate / ppem; 1034c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } 104303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 105303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod private: 106303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod USHORT caretValueFormat; /* Format identifier--format = 1 */ 107303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod SHORT coordinate; /* X or Y value, in design units */ 1084c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 10912360f7c159826ae72271b34486dee59d96aa8caBehdad EsfahbodASSERT_SIZE (CaretValueFormat1, 4); 1104c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 1114c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbodstruct CaretValueFormat2 { 1124c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 1137586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct CaretValue; 1147586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1157586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 1164c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod inline int get_caret_value (int ppem) const { 117303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod return /* TODO garbage */ 0 / ppem; 1184c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } 119303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 120303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod private: 121303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod USHORT caretValueFormat; /* Format identifier--format = 2 */ 122303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod USHORT caretValuePoint; /* Contour point index on glyph */ 1234c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 12412360f7c159826ae72271b34486dee59d96aa8caBehdad EsfahbodASSERT_SIZE (CaretValueFormat2, 4); 1254c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 1264c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbodstruct CaretValueFormat3 { 127303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 1287586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct CaretValue; 1297586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1307586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 1311f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod inline const Device& get_device (void) const { 1328b8358033184198ff638ee1379093717596e162dBehdad Esfahbod if (HB_UNLIKELY (!deviceTable)) return Null(Device); 1331f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod return *(const Device*)((const char*)this + deviceTable); 1344c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } 1354c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 136303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod inline int get_caret_value (int ppem) const { 1371f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod return /* TODO garbage */ (coordinate + get_device().get_delta (ppem)) / ppem; 138303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod } 139303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod 140303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod private: 1414c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod USHORT caretValueFormat; /* Format identifier--format = 3 */ 1424c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod SHORT coordinate; /* X or Y value, in design units */ 1434c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod Offset deviceTable; /* Offset to Device table for X or Y 1444c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * value--from beginning of CaretValue 1454c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod * table */ 1464c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 14712360f7c159826ae72271b34486dee59d96aa8caBehdad EsfahbodASSERT_SIZE (CaretValueFormat3, 6); 1484c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 1494c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbodstruct CaretValue { 1504c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod /* XXX we need access to a load-contour-point vfunc here */ 1517586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod int get_caret_value (int ppem) const { 1524c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod switch (u.caretValueFormat) { 1534c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod case 1: return u.format1.get_caret_value(ppem); 1544c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod case 2: return u.format2.get_caret_value(ppem); 1554c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod case 3: return u.format3.get_caret_value(ppem); 1564c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod default:return 0; 1574c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } 1584c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } 1594c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod 160303fe62824d4e99df554b6bfaacba05d068522fbBehdad Esfahbod private: 1614c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod union { 1624c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod USHORT caretValueFormat; /* Format identifier */ 1634c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod CaretValueFormat1 format1; 1644c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod CaretValueFormat2 format2; 1654c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod CaretValueFormat3 format3; 1664c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod } u; 1674c2556cb4c38a56c3a5087deb54aa6262ab3aff9Behdad Esfahbod}; 1681f437e6f47fb6c15761021bd2078f31778f2179cBehdad EsfahbodDEFINE_NULL (CaretValue, 2); 1691f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod 1701f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbodstruct LigGlyph { 1717586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1727586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct LigCaretList; 1737586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1747586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 1751f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod /* Caret value tables, in increasing coordinate order */ 1761f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod DEFINE_OFFSET_ARRAY_TYPE (CaretValue, caretValue, caretCount); 1771f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod /* TODO */ 1785b3f7702a64fe0513d08a67bdb72704e46fd7cd4Behdad Esfahbod 1791f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod private: 1801f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod USHORT caretCount; /* Number of CaretValues for this 1811f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * ligature (components - 1) */ 1821f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod Offset caretValue[]; /* Array of offsets to CaretValue 1831f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * tables--from beginning of LigGlyph 1841f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * table--in increasing coordinate 1851f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * order */ 1861f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod}; 1878b8358033184198ff638ee1379093717596e162dBehdad EsfahbodASSERT_SIZE (LigGlyph, 2); 188b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 18912360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbodstruct LigCaretList { 1907586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1917586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod friend struct GDEF; 1927586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod 1937586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod private: 1942d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod /* const LigGlyph& get_lig_glyph (hb_codepoint_t glyph); */ 19512360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod DEFINE_INDIRECT_GLYPH_ARRAY_LOOKUP (LigGlyph, get_lig_glyph); 19612360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 19712360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod private: 1985a0b791184cf6ef39eae0570e14aca21abc32845Behdad Esfahbod /* LigGlyph tables, in Coverage Index order */ 19912360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod DEFINE_OFFSET_ARRAY_TYPE (LigGlyph, ligGlyph, ligGlyphCount); 20012360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 20112360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod private: 2023d54bd1293069fc3d3bdeeea8ad45036f3ee65f3Behdad Esfahbod OffsetTo<Coverage> 2033d54bd1293069fc3d3bdeeea8ad45036f3ee65f3Behdad Esfahbod coverage; /* Offset to Coverage table--from 20412360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod * beginning of LigCaretList table */ 20512360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod USHORT ligGlyphCount; /* Number of ligature glyphs */ 20612360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod Offset ligGlyph[]; /* Array of offsets to LigGlyph 20712360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod * tables--from beginning of 20812360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod * LigCaretList table--in Coverage 20912360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod * Index order */ 21012360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod}; 2118b8358033184198ff638ee1379093717596e162dBehdad EsfahbodASSERT_SIZE (LigCaretList, 4); 21212360f7c159826ae72271b34486dee59d96aa8caBehdad Esfahbod 2131f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod/* 214aefaafe5bc4fc6d37a412c135b1079c287be7045Behdad Esfahbod * GDEF 2151f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod */ 216b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 217aefaafe5bc4fc6d37a412c135b1079c287be7045Behdad Esfahbodstruct GDEF { 2187586089c6fa8185cad8387869d3703c637e5cbb1Behdad Esfahbod static const hb_tag_t Tag = HB_TAG ('G','D','E','F'); 219600e5eb80f553ea8eb862e6784133574c74ca513Behdad Esfahbod 220aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod static const hb_ot_layout_class_t UnclassifiedGlyph = 0; 221aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod static const hb_ot_layout_class_t BaseGlyph = 1; 222aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod static const hb_ot_layout_class_t LigatureGlyph = 2; 223aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod static const hb_ot_layout_class_t MarkGlyph = 3; 224aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod static const hb_ot_layout_class_t ComponentGlyph = 4; 225aff831ed6787abe8e24a977e34d97ff2e0b7dc21Behdad Esfahbod 226aefaafe5bc4fc6d37a412c135b1079c287be7045Behdad Esfahbod STATIC_DEFINE_GET_FOR_DATA (GDEF); 227aefaafe5bc4fc6d37a412c135b1079c287be7045Behdad Esfahbod /* XXX check version here? */ 228b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 2299e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod inline bool has_glyph_classes () const { return glyphClassDef != 0; } 2302d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod inline hb_ot_layout_class_t get_glyph_class (hb_codepoint_t glyph) const { 2319e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod return glyphClassDef(this).get_class (glyph); 232b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod } 233b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 2349e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod inline bool has_mark_attachment_types () const { return markAttachClassDef != 0; } 2352d15e72c75931398db5e027e660f1320bb979117Behdad Esfahbod inline hb_ot_layout_class_t get_mark_attachment_type (hb_codepoint_t glyph) const { 2369e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod return markAttachClassDef(this).get_class (glyph); 237b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod } 238b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 239b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod /* TODO get_attach and get_lig_caret */ 2409e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod inline bool has_attach_list () const { return attachList != 0; } 2419e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod inline bool has_lig_caret_list () const { return ligCaretList != 0; } 242b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 243b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod Fixed version; /* Version of the GDEF table--initially 244b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod * 0x00010000 */ 2459e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod OffsetTo<ClassDef> 2469e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod glyphClassDef; /* Offset to class definition table 247b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod * for glyph type--from beginning of 2481f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * GDEF header (may be Null) */ 2499e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod OffsetTo<AttachList> 2509e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod attachList; /* Offset to list of glyphs with 251b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod * attachment points--from beginning 2521f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * of GDEF header (may be Null) */ 2539e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod OffsetTo<LigCaretList> 2549e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod ligCaretList; /* Offset to list of positioning points 255b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod * for ligature carets--from beginning 2561f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * of GDEF header (may be Null) */ 2579e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod OffsetTo<ClassDef> 2589e4d9d7b2721859172bc9c59c1aea27b01eb9c07Behdad Esfahbod markAttachClassDef; /* Offset to class definition table for 259b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod * mark attachment type--from beginning 2601f437e6f47fb6c15761021bd2078f31778f2179cBehdad Esfahbod * of GDEF header (may be Null) */ 261b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod}; 2628b8358033184198ff638ee1379093717596e162dBehdad EsfahbodASSERT_SIZE (GDEF, 12); 263b9d7688fb3d45894901484b74095c4f11cab6196Behdad Esfahbod 2648dd1c8b8d6797d899d0f5b0a8015886bf6520ca2Behdad Esfahbod#endif /* HB_OT_LAYOUT_GDEF_PRIVATE_H */ 265