mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-03 05:10:13 -05:00
fix text
This commit is contained in:
parent
222dbaa5fc
commit
8cd89b2bbf
2 changed files with 12 additions and 11 deletions
|
@ -22,7 +22,7 @@ export const createPenpotText = (
|
||||||
fills: translateFills(val.fills /*, node.width, node.height*/),
|
fills: translateFills(val.fills /*, node.width, node.height*/),
|
||||||
fontFamily: val.fontName.family,
|
fontFamily: val.fontName.family,
|
||||||
fontSize: val.fontSize.toString(),
|
fontSize: val.fontSize.toString(),
|
||||||
fontStyle: 'normal',
|
fontStyle: val.fontName.style,
|
||||||
fontWeight: val.fontWeight.toString(),
|
fontWeight: val.fontWeight.toString(),
|
||||||
textDecoration: translateTextDecoration(val),
|
textDecoration: translateTextDecoration(val),
|
||||||
textTransform: translateTextTransform(val)
|
textTransform: translateTextTransform(val)
|
||||||
|
@ -33,6 +33,7 @@ export const createPenpotText = (
|
||||||
// letterSpacing: val.letterSpacing,
|
// letterSpacing: val.letterSpacing,
|
||||||
} as TextNode;
|
} as TextNode;
|
||||||
});
|
});
|
||||||
|
console.log(node);
|
||||||
|
|
||||||
file.fontNames.add(node.fontName);
|
file.fontNames.add(node.fontName);
|
||||||
|
|
||||||
|
@ -52,19 +53,19 @@ export const createPenpotText = (
|
||||||
type: 'paragraph-set',
|
type: 'paragraph-set',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
// lineHeight: node.lineHeight,
|
type: 'paragraph',
|
||||||
fontStyle: 'normal',
|
fills: translateFills(node.fills /*, node.width, node.height*/),
|
||||||
children: children,
|
fontFamily: node.fontName.family,
|
||||||
|
fontSize: node.fontSize.toString(),
|
||||||
|
fontStyle: node.fontName.style,
|
||||||
|
fontWeight: node.fontWeight.toString(),
|
||||||
|
textDecoration: translateTextDecoration(node),
|
||||||
textTransform: translateTextTransform(node),
|
textTransform: translateTextTransform(node),
|
||||||
|
children: children
|
||||||
|
// lineHeight: node.lineHeight,
|
||||||
// textAlign: translateHorizontalAlign(node.textAlignHorizontal),
|
// textAlign: translateHorizontalAlign(node.textAlignHorizontal),
|
||||||
// fontId: 'gfont-' + slugify(node.fontName.family.toLowerCase()),
|
// fontId: 'gfont-' + slugify(node.fontName.family.toLowerCase()),
|
||||||
fontSize: node.fontSize.toString(),
|
|
||||||
fontWeight: node.fontWeight.toString(),
|
|
||||||
type: 'paragraph',
|
|
||||||
textDecoration: translateTextDecoration(node),
|
|
||||||
// letterSpacing: node.letterSpacing,
|
// letterSpacing: node.letterSpacing,
|
||||||
fills: translateFills(node.fills /*, node.width, node.height*/),
|
|
||||||
fontFamily: node.fontName.family
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
2
src/ui/lib/types/text/textAttributes.d.ts
vendored
2
src/ui/lib/types/text/textAttributes.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
import { TextContent } from './textContent';
|
import { TextContent } from './textContent';
|
||||||
|
|
||||||
export type TextAttributes = {
|
export type TextAttributes = {
|
||||||
id?: string;
|
id?: any;
|
||||||
type: symbol;
|
type: symbol;
|
||||||
content?: TextContent;
|
content?: TextContent;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue