0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-04-17 09:21:34 -05:00
This commit is contained in:
Jordi Sala Morales 2024-06-18 11:24:08 +00:00
parent 69e2f9e304
commit c84a4c81ec
No known key found for this signature in database
GPG key ID: C5127140107F55FD

View file

@ -4,22 +4,16 @@ import { isLocalFont } from '@plugin/translators/text/font/local';
export const findAllTextNodes = async () => {
const fonts = new Set<string>();
let totalTime = 0;
for (const page of figma.root.children) {
await page.loadAsync();
const nodes = page.findAll(node => node.type === 'TEXT') as TextNode[];
const startDate = Date.now();
for (const node of nodes) {
extractMissingFonts(node, fonts);
}
totalTime += Date.now() - startDate;
}
console.log('Time to find all text nodes:', totalTime);
figma.ui.postMessage({
type: 'CUSTOM_FONTS',
data: Array.from(fonts)