Commit 2ecf75b0 authored by rockyl's avatar rockyl

完善文本逻辑

parent 901b139a
...@@ -258,11 +258,12 @@ async function execute$1(psdFile, options) { ...@@ -258,11 +258,12 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
properties.size = styles.sizes()[0] / 2;
let [r, g, b, a] = fontInfo.colors()[0]; let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`; properties.fillColor = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { /*properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };*/
viewNode.type = 'label'; viewNode.type = 'label';
} else if (solidColor) { } else if (solidColor) {
const {r, g, b} = solidColor(); const {r, g, b} = solidColor();
......
This diff is collapsed.
...@@ -264,11 +264,12 @@ async function execute$1(psdFile, options) { ...@@ -264,11 +264,12 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
properties.size = styles.sizes()[0] / 2;
let [r, g, b, a] = fontInfo.colors()[0]; let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`; properties.fillColor = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { /*properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };*/
viewNode.type = 'label'; viewNode.type = 'label';
} else if (solidColor) { } else if (solidColor) {
const {r, g, b} = solidColor(); const {r, g, b} = solidColor();
......
This diff is collapsed.
...@@ -264,11 +264,12 @@ ...@@ -264,11 +264,12 @@
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
properties.size = styles.sizes()[0] / 2;
let [r, g, b, a] = fontInfo.colors()[0]; let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`; properties.fillColor = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { /*properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };*/
viewNode.type = 'label'; viewNode.type = 'label';
} else if (solidColor) { } else if (solidColor) {
const {r, g, b} = solidColor(); const {r, g, b} = solidColor();
......
This diff is collapsed.
...@@ -51,11 +51,12 @@ export async function execute(psdFile, options) { ...@@ -51,11 +51,12 @@ export async function execute(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
properties.size = styles.sizes()[0] / 2;
let [r, g, b, a] = fontInfo.colors()[0]; let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`; properties.fillColor = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { /*properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };*/
viewNode.type = 'label'; viewNode.type = 'label';
} else if (solidColor) { } else if (solidColor) {
const {r, g, b} = solidColor(); const {r, g, b} = solidColor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment