OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gsub.h" | 5 #include "gsub.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "gdef.h" | 10 #include "gdef.h" |
11 #include "gpos.h" | 11 #include "gpos.h" |
12 #include "layout.h" | 12 #include "layout.h" |
13 #include "maxp.h" | 13 #include "maxp.h" |
14 | 14 |
15 // GSUB - The Glyph Substitution Table | 15 // GSUB - The Glyph Substitution Table |
16 // http://www.microsoft.com/typography/otspec/gsub.htm | 16 // http://www.microsoft.com/typography/otspec/gsub.htm |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // The GSUB header size | 20 // The GSUB header size |
21 const size_t kGsubHeaderSize = 8; | 21 const size_t kGsubHeaderSize = 4 + 3 * 2; |
22 | 22 |
23 enum GSUB_TYPE { | 23 enum GSUB_TYPE { |
24 GSUB_TYPE_SINGLE = 1, | 24 GSUB_TYPE_SINGLE = 1, |
25 GSUB_TYPE_MULTIPLE = 2, | 25 GSUB_TYPE_MULTIPLE = 2, |
26 GSUB_TYPE_ALTERNATE = 3, | 26 GSUB_TYPE_ALTERNATE = 3, |
27 GSUB_TYPE_LIGATURE = 4, | 27 GSUB_TYPE_LIGATURE = 4, |
28 GSUB_TYPE_CONTEXT = 5, | 28 GSUB_TYPE_CONTEXT = 5, |
29 GSUB_TYPE_CHANGING_CONTEXT = 6, | 29 GSUB_TYPE_CHANGING_CONTEXT = 6, |
30 GSUB_TYPE_EXTENSION_SUBSTITUTION = 7, | 30 GSUB_TYPE_EXTENSION_SUBSTITUTION = 7, |
31 GSUB_TYPE_REVERSE_CHAINING_CONTEXT_SINGLE = 8, | 31 GSUB_TYPE_REVERSE_CHAINING_CONTEXT_SINGLE = 8, |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 return true; | 666 return true; |
667 } | 667 } |
668 | 668 |
669 void ots_gsub_free(OpenTypeFile *file) { | 669 void ots_gsub_free(OpenTypeFile *file) { |
670 delete file->gsub; | 670 delete file->gsub; |
671 } | 671 } |
672 | 672 |
673 } // namespace ots | 673 } // namespace ots |
674 | 674 |
OLD | NEW |