1/*
2 * Copyright © 2007,2008,2009 Red Hat, Inc.
3 * Copyright © 2010,2012 Google, Inc.
4 *
5 * This is part of HarfBuzz, a text shaping library.
6 *
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
12 *
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17 * DAMAGE.
18 *
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 *
25 * Red Hat Author(s): Behdad Esfahbod
26 * Google Author(s): Behdad Esfahbod, Garret Rieger
27 */
28
29#ifndef OT_LAYOUT_TYPES_HH
30#define OT_LAYOUT_TYPES_HH
31
32namespace OT {
33namespace Layout {
34
35struct SmallTypes {
36 static constexpr unsigned size = 2;
37 using large_int = uint32_t;
38 using HBUINT = HBUINT16;
39 using HBGlyphID = HBGlyphID16;
40 using Offset = Offset16;
41 template <typename Type, bool has_null=true>
42 using OffsetTo = OT::Offset16To<Type, has_null>;
43 template <typename Type>
44 using ArrayOf = OT::Array16Of<Type>;
45 template <typename Type>
46 using SortedArrayOf = OT::SortedArray16Of<Type>;
47};
48
49struct MediumTypes {
50 static constexpr unsigned size = 3;
51 using large_int = uint64_t;
52 using HBUINT = HBUINT24;
53 using HBGlyphID = HBGlyphID24;
54 using Offset = Offset24;
55 template <typename Type, bool has_null=true>
56 using OffsetTo = OT::Offset24To<Type, has_null>;
57 template <typename Type>
58 using ArrayOf = OT::Array24Of<Type>;
59 template <typename Type>
60 using SortedArrayOf = OT::SortedArray24Of<Type>;
61};
62
63}
64}
65
66#endif /* OT_LAYOUT_TYPES_HH */
67