fonteditor-core
Version:
fonts (ttf, woff, woff2, eot, svg, otf) parse, write, transform, glyph adjust.
30 lines (28 loc) • 813 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getCFFString;
var _cffStandardStrings = _interopRequireDefault(require("./cffStandardStrings"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file 获取cff字符串
* @author mengke01(kekee000@gmail.com)
*/
/**
* 根据索引获取cff字符串
*
* @param {Object} strings 标准cff字符串索引
* @param {number} index 索引号
* @return {number} 字符串索引
*/
function getCFFString(strings, index) {
if (index <= 390) {
index = _cffStandardStrings.default[index];
}
// Strings below index 392 are standard CFF strings and are not encoded in the font.
else {
index = strings[index - 391];
}
return index;
}