| 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 17 matching lines...) Expand all Loading... |
| 28 // Arguments: | 28 // Arguments: |
| 29 // global_subrs_index: Global subroutines which could be called by a charstring | 29 // global_subrs_index: Global subroutines which could be called by a charstring |
| 30 // in |char_strings_index|. | 30 // in |char_strings_index|. |
| 31 // fd_select: A map from glyph # to font #. | 31 // fd_select: A map from glyph # to font #. |
| 32 // local_subrs_per_font: A list of Local Subrs associated with FDArrays. Can be | 32 // local_subrs_per_font: A list of Local Subrs associated with FDArrays. Can be |
| 33 // empty. | 33 // empty. |
| 34 // local_subrs: A Local Subrs associated with Top DICT. Can be NULL. | 34 // local_subrs: A Local Subrs associated with Top DICT. Can be NULL. |
| 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 OpenTypeFile *file, |
| 38 const CFFIndex &char_strings_index, | 39 const CFFIndex &char_strings_index, |
| 39 const CFFIndex &global_subrs_index, | 40 const CFFIndex &global_subrs_index, |
| 40 const std::map<uint16_t, uint8_t> &fd_select, | 41 const std::map<uint16_t, uint8_t> &fd_select, |
| 41 const std::vector<CFFIndex *> &local_subrs_per_font, | 42 const std::vector<CFFIndex *> &local_subrs_per_font, |
| 42 const CFFIndex *local_subrs, | 43 const CFFIndex *local_subrs, |
| 43 Buffer *cff_table); | 44 Buffer *cff_table); |
| 44 | 45 |
| 45 // The list of Operators. See Appendix. A in Adobe Technical Note #5177. | 46 // The list of Operators. See Appendix. A in Adobe Technical Note #5177. |
| 46 enum Type2CharStringOperator { | 47 enum Type2CharStringOperator { |
| 47 kHStem = 1, | 48 kHStem = 1, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 60 kRMoveTo = 21, | 61 kRMoveTo = 21, |
| 61 kHMoveTo = 22, | 62 kHMoveTo = 22, |
| 62 kVStemHm = 23, | 63 kVStemHm = 23, |
| 63 kRCurveLine = 24, | 64 kRCurveLine = 24, |
| 64 kRLineCurve = 25, | 65 kRLineCurve = 25, |
| 65 kVVCurveTo = 26, | 66 kVVCurveTo = 26, |
| 66 kHHCurveTo = 27, | 67 kHHCurveTo = 27, |
| 67 kCallGSubr = 29, | 68 kCallGSubr = 29, |
| 68 kVHCurveTo = 30, | 69 kVHCurveTo = 30, |
| 69 kHVCurveTo = 31, | 70 kHVCurveTo = 31, |
| 71 kDotSection = 12 << 8, |
| 70 kAnd = (12 << 8) + 3, | 72 kAnd = (12 << 8) + 3, |
| 71 kOr = (12 << 8) + 4, | 73 kOr = (12 << 8) + 4, |
| 72 kNot = (12 << 8) + 5, | 74 kNot = (12 << 8) + 5, |
| 73 kAbs = (12 << 8) + 9, | 75 kAbs = (12 << 8) + 9, |
| 74 kAdd = (12 << 8) + 10, | 76 kAdd = (12 << 8) + 10, |
| 75 kSub = (12 << 8) + 11, | 77 kSub = (12 << 8) + 11, |
| 76 kDiv = (12 << 8) + 12, | 78 kDiv = (12 << 8) + 12, |
| 77 kNeg = (12 << 8) + 14, | 79 kNeg = (12 << 8) + 14, |
| 78 kEq = (12 << 8) + 15, | 80 kEq = (12 << 8) + 15, |
| 79 kDrop = (12 << 8) + 18, | 81 kDrop = (12 << 8) + 18, |
| 80 kPut = (12 << 8) + 20, | 82 kPut = (12 << 8) + 20, |
| 81 kGet = (12 << 8) + 21, | 83 kGet = (12 << 8) + 21, |
| 82 kIfElse = (12 << 8) + 22, | 84 kIfElse = (12 << 8) + 22, |
| 83 kRandom = (12 << 8) + 23, | 85 kRandom = (12 << 8) + 23, |
| 84 kMul = (12 << 8) + 24, | 86 kMul = (12 << 8) + 24, |
| 85 kSqrt = (12 << 8) + 26, | 87 kSqrt = (12 << 8) + 26, |
| 86 kDup = (12 << 8) + 27, | 88 kDup = (12 << 8) + 27, |
| 87 kExch = (12 << 8) + 28, | 89 kExch = (12 << 8) + 28, |
| 88 kIndex = (12 << 8) + 29, | 90 kIndex = (12 << 8) + 29, |
| 89 kRoll = (12 << 8) + 30, | 91 kRoll = (12 << 8) + 30, |
| 90 kHFlex = (12 << 8) + 34, | 92 kHFlex = (12 << 8) + 34, |
| 91 kFlex = (12 << 8) + 35, | 93 kFlex = (12 << 8) + 35, |
| 92 kHFlex1 = (12 << 8) + 36, | 94 kHFlex1 = (12 << 8) + 36, |
| 93 kFlex1 = (12 << 8) + 37, | 95 kFlex1 = (12 << 8) + 37, |
| 94 // Operators that are obsoleted or undocumented, such as 'blend', will be | 96 // Operators that are undocumented, such as 'blend', will be rejected. |
| 95 // rejected. | |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 } // namespace ots | 99 } // namespace ots |
| 99 | 100 |
| 100 #endif // OTS_CFF_TYPE2_CHARSTRING_H_ | 101 #endif // OTS_CFF_TYPE2_CHARSTRING_H_ |
| OLD | NEW |