hb-ot-cmap-table.hh revision 91bbfca87527fa14d6ebec86b087f2a989381872
141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod/*
241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * Copyright © 2014  Google, Inc.
341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *
441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *  This is part of HarfBuzz, a text shaping library.
541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *
641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * Permission is hereby granted, without written agreement and without
741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * license or royalty fees, to use, copy, modify, and distribute this
841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * software and its documentation for any purpose, provided that the
941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * above copyright notice and the following two paragraphs appear in
1041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * all copies of this software.
1141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *
1241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
1341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
1441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
1541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
1641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * DAMAGE.
1741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *
1841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
1941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
2041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
2141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
2241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
2341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod *
2441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * Google Author(s): Behdad Esfahbod
2541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod */
2641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
2741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#ifndef HB_OT_CMAP_TABLE_HH
2841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#define HB_OT_CMAP_TABLE_HH
2941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#include "hb-open-type-private.hh"
3141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbodnamespace OT {
3441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod/*
3741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod * cmap -- Character To Glyph Index Mapping Table
3841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod */
3941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
4041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#define HB_OT_TAG_cmap HB_TAG('c','m','a','p')
4141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
4241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
4341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbodstruct CmapSubtableFormat4
4441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod{
4541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  friend struct CmapSubtable;
4641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
4741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  private:
4841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
4941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  {
50c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    unsigned int segCount;
51c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    const USHORT *endCount;
52c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    const USHORT *startCount;
53c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    const USHORT *idDelta;
54c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    const USHORT *idRangeOffset;
55c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    const USHORT *glyphIdArray;
56c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    unsigned int glyphIdArrayLength;
57c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod
58c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    segCount = this->segCountX2 / 2;
59c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    endCount = this->values;
60c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    startCount = endCount + segCount + 1;
61c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    idDelta = startCount + segCount;
62c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    idRangeOffset = idDelta + segCount;
63c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    glyphIdArray = idRangeOffset + segCount;
64c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    glyphIdArrayLength = (this->length - 16 - 8 * segCount) / 2;
65c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod
66c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    /* Custom bsearch. */
67c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    int min = 0, max = (int) segCount - 1;
68c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    unsigned int i;
69c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    while (min <= max)
70c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    {
71c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      int mid = (min + max) / 2;
72c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      if (codepoint < startCount[mid])
73c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod        max = mid - 1;
74c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      else if (codepoint > endCount[mid])
75c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod        min = mid + 1;
76c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      else
77c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      {
78c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod	i = mid;
79c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod	goto found;
80c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      }
81c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    }
8241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    return false;
83c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod
84c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod  found:
85c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    hb_codepoint_t gid;
86c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    unsigned int rangeOffset = idRangeOffset[i];
87c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    if (rangeOffset == 0)
88c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      gid = codepoint + idDelta[i];
89c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    else
90c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    {
91c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      /* Somebody has been smoking... */
92c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      unsigned int index = rangeOffset / 2 + (codepoint - startCount[i]) + i - segCount;
93c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      if (unlikely (index >= glyphIdArrayLength))
94c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod	return false;
95c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      gid = glyphIdArray[index];
96c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      if (unlikely (!gid))
97c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod	return false;
98c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod      gid += idDelta[i];
99c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    }
100c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod
101c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    *glyph = gid & 0xFFFF;
102c8a47452993b9dee6854bfc866aca4a20142696fBehdad Esfahbod    return true;
10341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
10441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
10541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
10641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    TRACE_SANITIZE (this);
10741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) &&
10841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod			 c->check_range (this, length) &&
10941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod			 16 + 4 * (unsigned int) segCountX2 < length);
11041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
11141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
11241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  protected:
11341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	format;		/* Format number is set to 4. */
11441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	length;		/* This is the length in bytes of the
11541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod				 * subtable. */
11641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	language;	/* Ignore. */
11741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	segCountX2;	/* 2 x segCount. */
11841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	searchRange;	/* 2 * (2**floor(log2(segCount))) */
11941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	entrySelector;	/* log2(searchRange/2) */
12041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	rangeShift;	/* 2 x segCount - searchRange */
12141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
12241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	values[VAR];
12341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#if 0
12441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	endCount[segCount];	/* End characterCode for each segment,
12541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod					 * last=0xFFFF. */
12641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	reservedPad;		/* Set to 0. */
12741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	startCount[segCount];	/* Start character code for each segment. */
12841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  SHORT		idDelta[segCount];	/* Delta for all character codes in segment. */
12941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	idRangeOffset[segCount];/* Offsets into glyphIdArray or 0 */
13041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	glyphIdArray[VAR];	/* Glyph index array (arbitrary length) */
13141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#endif
13241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
13341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  public:
13441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  DEFINE_SIZE_ARRAY (14, values);
13541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod};
13641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
137d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbodstruct CmapSubtableLongGroup
1380d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod{
1390d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  friend struct CmapSubtableFormat12;
140d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  friend struct CmapSubtableFormat13;
1410d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
1420d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  int cmp (hb_codepoint_t codepoint) const
1430d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  {
1440d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    if (codepoint < startCharCode) return -1;
1450d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    if (codepoint > endCharCode)   return +1;
1460d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    return 0;
1470d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  }
1480d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
1490d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
1500d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    TRACE_SANITIZE (this);
1510d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this));
1520d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  }
1530d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
1540d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  private:
1550d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  ULONG		startCharCode;	/* First character code in this group. */
1560d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  ULONG		endCharCode;	/* Last character code in this group. */
157d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  ULONG		glyphID;	/* Glyph index; interpretation depends on
158d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod				 * subtable format. */
1590d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  public:
1600d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  DEFINE_SIZE_STATIC (12);
1610d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod};
1620d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
16391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbodstruct CmapSubtableFormat6
16491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod{
16591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  friend struct CmapSubtable;
16691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
16791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  private:
16891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
16991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  {
17091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    /* Rely on our implicit array bound-checking. */
17191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode];
17291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    if (!gid)
17391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod      return false;
17491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    *glyph = gid;
17591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    return true;
17691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  }
17791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
17891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
17991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    TRACE_SANITIZE (this);
18091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c));
18191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  }
18291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
18391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  protected:
18491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	format;		/* Subtable format; set to 6. */
18591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	length;		/* Byte length of this subtable. */
18691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	language;	/* Ignore. */
18791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	startCharCode;	/* First character code covered. */
18891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ArrayOf<GlyphID>
18991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod		glyphIdArray;	/* Array of glyph index values for character
19091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod				 * codes in the range. */
19191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  public:
19291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  DEFINE_SIZE_ARRAY (10, glyphIdArray);
19391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod};
19491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
19591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbodstruct CmapSubtableFormat10
19691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod{
19791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  friend struct CmapSubtable;
19891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
19991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  private:
20091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
20191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  {
20291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    /* Rely on our implicit array bound-checking. */
20391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode];
20491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    if (!gid)
20591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod      return false;
20691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    *glyph = gid;
20791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    return true;
20891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  }
20991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
21091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
21191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    TRACE_SANITIZE (this);
21291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c));
21391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  }
21491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
21591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  protected:
21691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	format;		/* Subtable format; set to 10. */
21791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	reserved;	/* Reserved; set to 0. */
21891bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ULONG		length;		/* Byte length of this subtable. */
21991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ULONG		language;	/* Ignore. */
22091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ULONG		startCharCode;	/* First character code covered. */
22191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  LongArrayOf<GlyphID>
22291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod		glyphIdArray;	/* Array of glyph index values for character
22391bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod				 * codes in the range. */
22491bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  public:
22591bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  DEFINE_SIZE_ARRAY (20, glyphIdArray);
22691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod};
22791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod
2280d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbodstruct CmapSubtableFormat12
2290d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod{
2300d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  friend struct CmapSubtable;
2310d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
2320d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  private:
2330d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
2340d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  {
2350d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    int i = groups.search (codepoint);
2360d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    if (i == -1)
2370d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod      return false;
238d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    const CmapSubtableLongGroup &group = groups[i];
239d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    *glyph = group.glyphID + (codepoint - group.startCharCode);
2400d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    return true;
2410d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  }
2420d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
2430d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
2440d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    TRACE_SANITIZE (this);
2450d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c));
2460d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  }
2470d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
2480d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  protected:
2490d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  USHORT	format;		/* Subtable format; set to 12. */
2500d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  USHORT	reserved;	/* Reserved; set to 0. */
25191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ULONG		length;		/* Byte length of this subtable. */
2520d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  ULONG		language;	/* Ignore. */
253d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  LongArrayOf<CmapSubtableLongGroup>
254d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod		groups;		/* Groupings. */
255d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  public:
256d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  DEFINE_SIZE_ARRAY (16, groups);
257d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod};
258d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod
259d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbodstruct CmapSubtableFormat13
260d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod{
261d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  friend struct CmapSubtable;
262d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod
263d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  private:
264d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
265d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  {
266d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    int i = groups.search (codepoint);
267d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    if (i == -1)
268d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod      return false;
269d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    const CmapSubtableLongGroup &group = groups[i];
270d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    *glyph = group.glyphID;
271d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    return true;
272d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  }
273d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod
274d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
275d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    TRACE_SANITIZE (this);
276d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c));
277d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  }
278d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod
279d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  protected:
28091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  USHORT	format;		/* Subtable format; set to 13. */
281d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  USHORT	reserved;	/* Reserved; set to 0. */
28291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  ULONG		length;		/* Byte length of this subtable. */
283d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  ULONG		language;	/* Ignore. */
284d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  LongArrayOf<CmapSubtableLongGroup>
2850d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod		groups;		/* Groupings. */
2860d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  public:
2870d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  DEFINE_SIZE_ARRAY (16, groups);
2880d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod};
2890d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod
29041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbodstruct CmapSubtable
29141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod{
29241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
29341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  {
29441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    switch (u.format) {
2950d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    case  4: return u.format4 .get_glyph(codepoint, glyph);
29691bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    case  6: return u.format6 .get_glyph(codepoint, glyph);
29791bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    case 10: return u.format10.get_glyph(codepoint, glyph);
2980d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    case 12: return u.format12.get_glyph(codepoint, glyph);
299d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    case 13: return u.format13.get_glyph(codepoint, glyph);
30041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    default:return false;
30141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    }
30241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
30341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
30441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
30541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    TRACE_SANITIZE (this);
30641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
30741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    switch (u.format) {
3080d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    case  4: return TRACE_RETURN (u.format4 .sanitize (c));
30991bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    case  6: return TRACE_RETURN (u.format6 .sanitize (c));
31091bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod    case 10: return TRACE_RETURN (u.format10.sanitize (c));
3110d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod    case 12: return TRACE_RETURN (u.format12.sanitize (c));
312d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod    case 13: return TRACE_RETURN (u.format13.sanitize (c));
31341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    default:return TRACE_RETURN (true);
31441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    }
31541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
31641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
31741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  protected:
31841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  union {
31941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT		format;		/* Format identifier */
32041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  CmapSubtableFormat4	format4;
32191bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  CmapSubtableFormat6	format6;
32291bbfca87527fa14d6ebec86b087f2a989381872Behdad Esfahbod  CmapSubtableFormat10	format10;
3230d75793fae95ed9f6b8522ae3af4fcdf397d8c36Behdad Esfahbod  CmapSubtableFormat12	format12;
324d294a2cb165c4f20daa5624969067c51eb9aef58Behdad Esfahbod  CmapSubtableFormat13	format13;
32541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  } u;
32641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  public:
32741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  DEFINE_SIZE_UNION (2, format);
32841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod};
32941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
33041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
33141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbodstruct EncodingRecord
33241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod{
33341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  int cmp (const EncodingRecord &other) const
33441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  {
33541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    int ret;
33641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    ret = other.platformID.cmp (platformID);
33741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    if (ret) return ret;
33841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    ret = other.encodingID.cmp (encodingID);
33941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    if (ret) return ret;
34041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    return 0;
34141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
34241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
34341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c, void *base) {
34441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    TRACE_SANITIZE (this);
34541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) &&
34641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod			 subtable.sanitize (c, base));
34741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
34841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
34941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	platformID;	/* Platform ID. */
35041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT	encodingID;	/* Platform-specific encoding ID. */
35141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  LongOffsetTo<CmapSubtable>
35241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod		subtable;	/* Byte offset from beginning of table to the subtable for this encoding. */
35341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  public:
35441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  DEFINE_SIZE_STATIC (8);
35541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod};
35641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
35741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbodstruct cmap
35841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod{
35941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  static const hb_tag_t tableTag	= HB_OT_TAG_cmap;
36041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3613608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod  inline const CmapSubtable *find_subtable (unsigned int platform_id,
3623608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod					    unsigned int encoding_id) const
36341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  {
36441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    EncodingRecord key;
36541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    key.platformID.set (platform_id);
36641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    key.encodingID.set (encoding_id);
36741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
3683608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod    int result = encodingRecord.search (key);
3693608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod    if (result == -1)
3703608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod      return NULL;
3713608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod
3723608a6847e7b7eb4206df049158513a085810afdBehdad Esfahbod    return &(this+encodingRecord[result].subtable);
37341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
37441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
37541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  inline bool sanitize (hb_sanitize_context_t *c) {
37641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    TRACE_SANITIZE (this);
37741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod    return TRACE_RETURN (c->check_struct (this) &&
37841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod			 likely (version == 0) &&
37941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod			 encodingRecord.sanitize (c, this));
38041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  }
38141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
38241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  USHORT			version;	/* Table version number (0). */
38341ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  ArrayOf<EncodingRecord>	encodingRecord;	/* Encoding tables. */
38441ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  public:
38541ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod  DEFINE_SIZE_ARRAY (4, encodingRecord);
38641ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod};
38741ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
38841ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
38941ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod} /* namespace OT */
39041ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
39141ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod
39241ca1fbebf61cf26e1e0e4b11f4a5b52fb7d88a9Behdad Esfahbod#endif /* HB_OT_CMAP_TABLE_HH */
393