OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef OTS_CFF_TYPE2_CHARSTRING_H_ | 5 #ifndef OTS_CFF_TYPE2_CHARSTRING_H_ |
6 #define OTS_CFF_TYPE2_CHARSTRING_H_ | 6 #define OTS_CFF_TYPE2_CHARSTRING_H_ |
7 | 7 |
8 #include "cff.h" | 8 #include "cff.h" |
9 #include "ots.h" | 9 #include "ots.h" |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 // cff_table: A buffer which contains actual byte code of charstring, global | 35 // cff_table: A buffer which contains actual byte code of charstring, global |
36 // subroutines and local subroutines. | 36 // subroutines and local subroutines. |
37 bool ValidateType2CharStringIndex( | 37 bool ValidateType2CharStringIndex( |
38 const CFFIndex &char_strings_index, | 38 const CFFIndex &char_strings_index, |
39 const CFFIndex &global_subrs_index, | 39 const CFFIndex &global_subrs_index, |
40 const std::map<uint16_t, uint8_t> &fd_select, | 40 const std::map<uint16_t, uint8_t> &fd_select, |
41 const std::vector<CFFIndex *> &local_subrs_per_font, | 41 const std::vector<CFFIndex *> &local_subrs_per_font, |
42 const CFFIndex *local_subrs, | 42 const CFFIndex *local_subrs, |
43 Buffer *cff_table); | 43 Buffer *cff_table); |
44 | 44 |
| 45 // The list of Operators. See Appendix. A in Adobe Technical Note #5177. |
| 46 enum Type2CharStringOperator { |
| 47 kHStem = 1, |
| 48 kVStem = 3, |
| 49 kVMoveTo = 4, |
| 50 kRLineTo = 5, |
| 51 kHLineTo = 6, |
| 52 kVLineTo = 7, |
| 53 kRRCurveTo = 8, |
| 54 kCallSubr = 10, |
| 55 kReturn = 11, |
| 56 kEndChar = 14, |
| 57 kHStemHm = 18, |
| 58 kHintMask = 19, |
| 59 kCntrMask = 20, |
| 60 kRMoveTo = 21, |
| 61 kHMoveTo = 22, |
| 62 kVStemHm = 23, |
| 63 kRCurveLine = 24, |
| 64 kRLineCurve = 25, |
| 65 kVVCurveTo = 26, |
| 66 kHHCurveTo = 27, |
| 67 kCallGSubr = 29, |
| 68 kVHCurveTo = 30, |
| 69 kHVCurveTo = 31, |
| 70 kAnd = (12 << 8) + 3, |
| 71 kOr = (12 << 8) + 4, |
| 72 kNot = (12 << 8) + 5, |
| 73 kAbs = (12 << 8) + 9, |
| 74 kAdd = (12 << 8) + 10, |
| 75 kSub = (12 << 8) + 11, |
| 76 kDiv = (12 << 8) + 12, |
| 77 kNeg = (12 << 8) + 14, |
| 78 kEq = (12 << 8) + 15, |
| 79 kDrop = (12 << 8) + 18, |
| 80 kPut = (12 << 8) + 20, |
| 81 kGet = (12 << 8) + 21, |
| 82 kIfElse = (12 << 8) + 22, |
| 83 kRandom = (12 << 8) + 23, |
| 84 kMul = (12 << 8) + 24, |
| 85 kSqrt = (12 << 8) + 26, |
| 86 kDup = (12 << 8) + 27, |
| 87 kExch = (12 << 8) + 28, |
| 88 kIndex = (12 << 8) + 29, |
| 89 kRoll = (12 << 8) + 30, |
| 90 kHFlex = (12 << 8) + 34, |
| 91 kFlex = (12 << 8) + 35, |
| 92 kHFlex1 = (12 << 8) + 36, |
| 93 kFlex1 = (12 << 8) + 37, |
| 94 // Operators that are obsoleted or undocumented, such as 'blend', will be |
| 95 // rejected. |
| 96 }; |
| 97 |
45 } // namespace ots | 98 } // namespace ots |
46 | 99 |
47 #endif // OTS_CFF_TYPE2_CHARSTRING_H_ | 100 #endif // OTS_CFF_TYPE2_CHARSTRING_H_ |
OLD | NEW |