UNPKG

zp-figma-converter

Version:

Convert Figma designs to various code formats

32 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextAtlasParser = void 0; const xml_utils_1 = require("../../../../utils/xml-utils"); const widget_parser_1 = require("./widget-parser"); /** * Parser for TextAtlasData (AtlasLabel) */ class TextAtlasParser extends widget_parser_1.WidgetParser { parse(nodeData) { const result = this.parseBaseAttributes(nodeData); // TextAtlas specific properties if (nodeData.LabelText !== undefined) result['@_LabelText'] = nodeData.LabelText; if (nodeData.CharWidth !== undefined) result['@_CharWidth'] = (0, xml_utils_1.toString)(nodeData.CharWidth); if (nodeData.CharHeight !== undefined) result['@_CharHeight'] = (0, xml_utils_1.toString)(nodeData.CharHeight); if (nodeData.StartChar !== undefined) result['@_StartChar'] = nodeData.StartChar; if (nodeData.LabelAtlasFileImage_CNB) { result.LabelAtlasFileImage_CNB = { '@_Type': nodeData.LabelAtlasFileImage_CNB.Type, '@_Path': nodeData.LabelAtlasFileImage_CNB.Path, '@_Plist': nodeData.LabelAtlasFileImage_CNB.Plist }; } return result; } } exports.TextAtlasParser = TextAtlasParser; //# sourceMappingURL=text-atlas-parser.js.map