Created
November 23, 2024 04:43
-
-
Save hiloki/577c16097d82a5ee342d7a11fd9785de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const selection = figma.currentPage.selection[0]; // 最初の選択オブジェクト | |
if (selection && selection.type === "FRAME") { | |
const textNodes = selection.findAll((node) => node.type === "TEXT"); | |
textNodes.forEach(async (textNode) => { | |
await figma.loadFontAsync(textNode.fontName); // フォントをロード | |
textNode.fontSize *= 2; // フォントサイズを200%に | |
}); | |
figma.notify( | |
`フォントサイズを200%に拡大しました: ${textNodes.length}個のテキスト` | |
); | |
} else { | |
figma.notify("Frameを選択してください"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment