• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2011 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "sfntly/tag.cc"
18 #include "test/test_data.h"
19 
20 namespace sfntly {
21 
22 // If the TTF file used in test changed, the verify*.cc in test need to be
23 // changed also.
24 // TODO(arthurhsu): Refactor this into a test class and have all const inside.
25 //                  This way we can test multiple fonts using same set of
26 //                  code.
27 
28 const char* SAMPLE_TTF_FILE = "Tuffy.ttf";
29 const char* SAMPLE_BITMAP_FONT = "AnonymousPro-Regular.ttf";
30 
31 const size_t SAMPLE_TTF_SIZE = 183936;
32 const size_t SAMPLE_TTF_TABLES = 17;
33 const size_t SAMPLE_TTF_KNOWN_TAGS = 16;
34 const size_t SAMPLE_BITMAP_KNOWN_TAGS = 20;
35 const size_t SAMPLE_TTF_FEAT = 3;
36 const size_t SAMPLE_TTF_HEAD = 6;
37 const size_t SAMPLE_TTF_POST = 14;
38 
39 const int32_t TTF_KNOWN_TAGS[] = {
40     Tag::OS_2, Tag::cmap, Tag::cvt,  Tag::feat, Tag::gasp,
41     Tag::glyf, Tag::head, Tag::hhea, Tag::hmtx, Tag::kern,
42     Tag::loca, Tag::maxp, Tag::morx, Tag::name, Tag::post,
43     Tag::prop };
44 
45 const int32_t BITMAP_KNOWN_TAGS[] = {
46     Tag::EBDT, Tag::EBLC, Tag::EBSC, Tag::LTSH, Tag::OS_2,
47     Tag::VDMX, Tag::cmap, Tag::cvt,  Tag::fpgm, Tag::gasp,
48     Tag::glyf, Tag::hdmx, Tag::head, Tag::hhea, Tag::hmtx,
49     Tag::loca, Tag::maxp, Tag::name, Tag::post, Tag::prep };
50 
51 const int64_t TTF_CHECKSUM[] = {
52     0xD463FC48, 0x252028D1, 0x0065078A, 0xC01407B5, 0xFFFF0003,
53     0x9544342B, 0xFC8F16AD, 0x0EC30C7A, 0xA029CD5D, 0x32513087,
54     0x05C323B0, 0x06320195, 0x3B67E701, 0xE7DB08F3, 0xD46E5E89,
55     0xE6EB4A27 };
56 
57 const int64_t TTF_OFFSET[] = {
58     0x00000198, 0x00001964, 0x000025B0, 0x0002CA74, 0x0002C854,
59     0x00003D34, 0x0000011C, 0x00000154, 0x000001F0, 0x000245D8,
60     0x000025B8, 0x00000178, 0x0002CAB4, 0x00024860, 0x00028854,
61     0x0002C85C };
62 
63 const int32_t TTF_LENGTH[] = {
64             86,       3146,          8,         64,          8,
65         133284,         54,         36,       6002,        648,
66           6012,         32,        944,      16371,      16383,
67            536 };
68 
69 const unsigned char TTF_FEAT_DATA[] = {
70     0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
71     0, 0, 0, 0x30, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0x34,
72     0, 0, 1, 1, 0, 0xB, 0, 2, 0, 0, 0, 0x38, 0xC0, 0, 1, 2,
73     0, 0, 1, 3, 0, 2, 1, 4, 0, 0, 1, 5, 0, 2, 1, 6 };
74 
75 }  // namespace sfntly
76