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
{ | |
"Foundations": { | |
"blue010": { | |
"value": "#F6F6FF", | |
"type": "color" | |
}, | |
"blue020": { | |
"value": "#E2E2FF", | |
"type": "color" | |
}, |
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
{ | |
"weight": { | |
"100": { | |
"value": "Thin", | |
"type": "fontWeights", | |
"description": "Thin" | |
}, | |
"200": { | |
"value": "ExtraLight", | |
"type": "fontWeights", |
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
let input = figma.currentPage.selection[0] as TextNode | |
await figma.loadFontAsync(input.fontName as FontName) | |
let text = input.characters | |
let frame = figma.createFrame() | |
frame.fills = [] | |
frame.clipsContent = false | |
frame.layoutMode = "VERTICAL" |
This file has been truncated, but you can view the full file.
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
{ | |
"host": "fonts.gstatic.com", | |
"asset_url_pattern": "/s/i/{family}/{icon}/v{version}/{asset}", | |
"families": [ | |
"Material Icons", | |
"Material Icons Outlined", | |
"Material Icons Round", | |
"Material Icons Sharp", | |
"Material Icons Two Tone" | |
], |
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
Initialize engine version: 5.6.7f1 (e80cc3114ac1) | |
GfxDevice: creating device client; threaded=1 | |
Direct3D: | |
Version: Direct3D 11.0 [level 11.1] | |
Renderer: NVIDIA GeForce RTX 3080 (ID=0x2206) | |
Vendor: NVIDIA | |
VRAM: 10077 MB | |
Driver: 27.21.14.6140 | |
Begin MonoManager ReloadAssembly | |
Platform assembly: F:\SteamLibrary\steamapps\common\Cities_Skylines\Cities_Data\Managed\UnityEngine.dll (this message is harmless) |
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
type FontMetrics = { | |
capHeight: number, | |
ascent: number, | |
descent: number, | |
lineGap: number, | |
unitsPerEm: number | |
} | |
async function makeMetrics(fontName: FontName, unitsPerEm: number){ |
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
function zeroResize(node, width, height){ | |
//Workaround to resize a node, if its size is less than 0.01 | |
node.resize(width < 0.01 ? 1 : width,height < 0.01 ? 1 : height) | |
if(width < 0.01 || height < 0.01){ | |
let dummy = figma.createRectangle() | |
dummy.resize(width < 0.01 ? 1/width : width,height < 0.01 ? 1/height : height) | |
let group: GroupNode = figma.group([node,dummy],figma.currentPage) | |
group.resize(width < 0.01 ? 1 : width,height < 0.01 ? 1 : height) | |
group.parent.appendChild(node) | |
group.remove() |
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
let angle = 45 | |
let theta = angle * (Math.PI/180) //radians | |
let sel = figma.currentPage.selection[0] | |
//cx,cy is the center of the node | |
let cx = sel.x + sel.width/2 | |
let cy = sel.y + sel.height/2 | |
let newx = Math.cos(theta) * sel.x + sel.y * Math.sin(theta) - cy * Math.sin(theta) - cx * Math.cos(theta) + cx | |
let newy = - Math.sin(theta) * sel.x + cx * Math.sin(theta) + sel.y * Math.cos(theta) - cy * Math.cos(theta) + cy |
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
let sel = context.selection | |
sel.forEach(layer => { | |
layer.frame = layer.parentArtboard().frame() | |
if(layer.class() == 'MSTextLayer'){ | |
let txt = layer.stringValue() | |
layer.stringValue = 'T' | |
layer.frame().y = layer.frame().y() - (layer.pathInFrame().bounds().origin.y - layer.frame().y()) | |
layer.stringValue = txt | |
} |
NewerOlder