Imported Upstream version 2.10.4
[platform/upstream/freetype2.git] / src / sfnt / woff2tags.c
1 /****************************************************************************
2  *
3  * woff2tags.c
4  *
5  *   WOFF2 Font table tags (base).
6  *
7  * Copyright (C) 2019-2020 by
8  * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
9  *
10  * This file is part of the FreeType project, and may only be used,
11  * modified, and distributed under the terms of the FreeType project
12  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
13  * this file you indicate that you have read the license and
14  * understand and accept it fully.
15  *
16  */
17
18
19 #include <freetype/tttags.h>
20 #include "woff2tags.h"
21
22   /*
23    * Return tag from index in the order given in WOFF2 specification.
24    *
25    * See
26    *
27    *       https://www.w3.org/TR/WOFF2/#table_dir_format
28    *
29    * for details.
30    */
31   FT_LOCAL_DEF( FT_ULong )
32   woff2_known_tags( FT_Byte  index )
33   {
34     const FT_ULong  known_tags[63] =
35     {
36       FT_MAKE_TAG('c', 'm', 'a', 'p'),  /*  0  */
37       FT_MAKE_TAG('h', 'e', 'a', 'd'),  /*  1  */
38       FT_MAKE_TAG('h', 'h', 'e', 'a'),  /*  2  */
39       FT_MAKE_TAG('h', 'm', 't', 'x'),  /*  3  */
40       FT_MAKE_TAG('m', 'a', 'x', 'p'),  /*  4  */
41       FT_MAKE_TAG('n', 'a', 'm', 'e'),  /*  5  */
42       FT_MAKE_TAG('O', 'S', '/', '2'),  /*  6  */
43       FT_MAKE_TAG('p', 'o', 's', 't'),  /*  7  */
44       FT_MAKE_TAG('c', 'v', 't', ' '),  /*  8  */
45       FT_MAKE_TAG('f', 'p', 'g', 'm'),  /*  9  */
46       FT_MAKE_TAG('g', 'l', 'y', 'f'),  /*  10 */
47       FT_MAKE_TAG('l', 'o', 'c', 'a'),  /*  11 */
48       FT_MAKE_TAG('p', 'r', 'e', 'p'),  /*  12 */
49       FT_MAKE_TAG('C', 'F', 'F', ' '),  /*  13 */
50       FT_MAKE_TAG('V', 'O', 'R', 'G'),  /*  14 */
51       FT_MAKE_TAG('E', 'B', 'D', 'T'),  /*  15 */
52       FT_MAKE_TAG('E', 'B', 'L', 'C'),  /*  16 */
53       FT_MAKE_TAG('g', 'a', 's', 'p'),  /*  17 */
54       FT_MAKE_TAG('h', 'd', 'm', 'x'),  /*  18 */
55       FT_MAKE_TAG('k', 'e', 'r', 'n'),  /*  19 */
56       FT_MAKE_TAG('L', 'T', 'S', 'H'),  /*  20 */
57       FT_MAKE_TAG('P', 'C', 'L', 'T'),  /*  21 */
58       FT_MAKE_TAG('V', 'D', 'M', 'X'),  /*  22 */
59       FT_MAKE_TAG('v', 'h', 'e', 'a'),  /*  23 */
60       FT_MAKE_TAG('v', 'm', 't', 'x'),  /*  24 */
61       FT_MAKE_TAG('B', 'A', 'S', 'E'),  /*  25 */
62       FT_MAKE_TAG('G', 'D', 'E', 'F'),  /*  26 */
63       FT_MAKE_TAG('G', 'P', 'O', 'S'),  /*  27 */
64       FT_MAKE_TAG('G', 'S', 'U', 'B'),  /*  28 */
65       FT_MAKE_TAG('E', 'B', 'S', 'C'),  /*  29 */
66       FT_MAKE_TAG('J', 'S', 'T', 'F'),  /*  30 */
67       FT_MAKE_TAG('M', 'A', 'T', 'H'),  /*  31 */
68       FT_MAKE_TAG('C', 'B', 'D', 'T'),  /*  32 */
69       FT_MAKE_TAG('C', 'B', 'L', 'C'),  /*  33 */
70       FT_MAKE_TAG('C', 'O', 'L', 'R'),  /*  34 */
71       FT_MAKE_TAG('C', 'P', 'A', 'L'),  /*  35 */
72       FT_MAKE_TAG('S', 'V', 'G', ' '),  /*  36 */
73       FT_MAKE_TAG('s', 'b', 'i', 'x'),  /*  37 */
74       FT_MAKE_TAG('a', 'c', 'n', 't'),  /*  38 */
75       FT_MAKE_TAG('a', 'v', 'a', 'r'),  /*  39 */
76       FT_MAKE_TAG('b', 'd', 'a', 't'),  /*  40 */
77       FT_MAKE_TAG('b', 'l', 'o', 'c'),  /*  41 */
78       FT_MAKE_TAG('b', 's', 'l', 'n'),  /*  42 */
79       FT_MAKE_TAG('c', 'v', 'a', 'r'),  /*  43 */
80       FT_MAKE_TAG('f', 'd', 's', 'c'),  /*  44 */
81       FT_MAKE_TAG('f', 'e', 'a', 't'),  /*  45 */
82       FT_MAKE_TAG('f', 'm', 't', 'x'),  /*  46 */
83       FT_MAKE_TAG('f', 'v', 'a', 'r'),  /*  47 */
84       FT_MAKE_TAG('g', 'v', 'a', 'r'),  /*  48 */
85       FT_MAKE_TAG('h', 's', 't', 'y'),  /*  49 */
86       FT_MAKE_TAG('j', 'u', 's', 't'),  /*  50 */
87       FT_MAKE_TAG('l', 'c', 'a', 'r'),  /*  51 */
88       FT_MAKE_TAG('m', 'o', 'r', 't'),  /*  52 */
89       FT_MAKE_TAG('m', 'o', 'r', 'x'),  /*  53 */
90       FT_MAKE_TAG('o', 'p', 'b', 'd'),  /*  54 */
91       FT_MAKE_TAG('p', 'r', 'o', 'p'),  /*  55 */
92       FT_MAKE_TAG('t', 'r', 'a', 'k'),  /*  56 */
93       FT_MAKE_TAG('Z', 'a', 'p', 'f'),  /*  57 */
94       FT_MAKE_TAG('S', 'i', 'l', 'f'),  /*  58 */
95       FT_MAKE_TAG('G', 'l', 'a', 't'),  /*  59 */
96       FT_MAKE_TAG('G', 'l', 'o', 'c'),  /*  60 */
97       FT_MAKE_TAG('F', 'e', 'a', 't'),  /*  61 */
98       FT_MAKE_TAG('S', 'i', 'l', 'l'),  /*  62 */
99     };
100
101
102     if ( index > 62 )
103       return 0;
104
105     return known_tags[index];
106   }
107
108
109 /* END */