Skip to content

Instantly share code, notes, and snippets.

@hiloki
Created November 23, 2024 04:43
Show Gist options
  • Save hiloki/577c16097d82a5ee342d7a11fd9785de to your computer and use it in GitHub Desktop.
Save hiloki/577c16097d82a5ee342d7a11fd9785de to your computer and use it in GitHub Desktop.
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