sketch-json-parse
Version:
sketch-json解析
23 lines (22 loc) • 675 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 处理文字转换问题
*/
exports.default = (attributes) => {
const textStyle = {};
// 文字大小写转换
if (attributes.MSAttributedStringTextTransformAttribute == 1) {
textStyle.textTransform = 'uppercase';
}
else if (attributes.MSAttributedStringTextTransformAttribute == 2) {
textStyle.textTransform = 'lowercase';
}
if (attributes.underlineStyle == 1) {
textStyle.textDecoration = 'underline';
}
if (attributes.strikethroughStyle == 1) {
textStyle.textDecoration = 'line-through';
}
return textStyle;
};