Skip to content

Instantly share code, notes, and snippets.

@vorbei
Last active November 20, 2019 04:19
Show Gist options
  • Select an option

  • Save vorbei/a7c5e910aaeb5a7fb5397c5c833e453c to your computer and use it in GitHub Desktop.

Select an option

Save vorbei/a7c5e910aaeb5a7fb5397c5c833e453c to your computer and use it in GitHub Desktop.
Toggle Filled/Outlined SF Symbols using Figma Scripter
/*
Toggle Filled/Outlined SF Symbols via Figma Scripter:
Press Command+Enter in Figma Scripter to run.
NOTE: ONLY WORKS when text nodes with ONE SYMBOL.
It's a problem of javascript treating the UTF-8 character ranges inappropriately like emojis and SF Symbols.
*/
selection().forEach(n=>{
if(isText(n)){
n.characters = toggle(n.characters );
}
})
function toggle(p) {
const pairs = "􀈂􀈃 􀈄􀈅 􀈆􀈇 􀈈􀈉 􀈋􀈌 􀈑􀈒 􀈓􀈔 􀜧􀜨 􀈕􀈖 􀈗􀈘 􀈙􀈚 􀈛􀈜 􀈝􀈞 􀈟􀈠 􀈣􀈤 􀈥􀈦 􀈧􀈨 􀈩􀈪 􀈫􀈬 􀈭􀈮 􀈱􀈲 􀈵􀈶 􀈷􀈸 􀈹􀈺 􀈻􀈼 􀈽􀈾 􀈿􀉀 􀉁􀉂 􀉃􀉄 􀒎􀒏 􀉌􀉍 􀉎􀉏 􀉐􀉑 􀉒􀉓 􀉔􀉕 􀉚􀉛 􀉜􀉝 􀉞􀉟 􀒔􀒕 􀒠􀒡 􀉩􀉪 􀓣􀓤 􀜕􀜖 􀜗􀜘 􀉫􀉬 􀝊􀝋 􀉭􀉮 􀉯􀉰 􀉱􀉲 􀉳􀉴 􀉵􀉶 􀉷􀉸 􀉹􀉺 􀆗􀆘 􀆙􀆚 􀆛􀆜 􀆝􀆞 􀆡􀆢 􀆫􀆬 􀆭􀆮 􀆱􀆲 􀆳􀆴 􀆵􀆶 􀆷􀆸 􀆹􀆺 􀆻􀆼 􀆽􀆾 􀇀􀇁 􀇂􀇃 􀇄􀇅 􀇆􀇇 􀇈􀇉 􀇊􀇋 􀇌􀇍 􀇎􀇏 􀇐􀇑 􀇒􀇓 􀇔􀇕 􀇖􀇗 􀇘􀇙 􀇚􀇛 􀇜􀇝 􀇞􀇟 􀇠􀇡 􀇢􀇣 􀇴􀚅 􀇵􀚇 􀇶􀚆 􀇷􀚈 􀛦􀛧 􀓛􀚉 􀞾􀞿 􀇸􀇹 􀙢􀙣 􀇺􀇻 􀇼􀇽 􀇾􀇿 􀈀􀈁 􀊃􀊄 􀊕􀊖 􀊙􀊚 􀊅􀊆 􀊗􀊘 􀊛􀊜 􀛶􀛷 􀜪􀜫 􀊇􀊈 􀊉􀊊 􀊋􀊌 􀊍􀊎 􀊏􀊐 􀊑􀊒 􀊓􀊔 􀆥􀆦 􀊠􀊡 􀊢􀊣 􀌊􀑞 􀊤􀊥 􀊦􀊧 􀊨􀊩 􀒒􀒓 􀊰􀊱 􀒩􀒪 􀊲􀊳 􀒂􀊼 􀒃􀊽 􀒅􀊾 􀒄􀊿 􀊴􀊵 􀊸􀊹 􀊶􀊷 􀊺􀊻 􀋀􀋁 􀋂􀋃 􀋅􀋆 􀋇􀋈 􀋉􀋊 􀋋􀋌 􀋍􀋎 􀋑􀋒 􀘬􀘭 􀋓􀋔 􀋕􀋖 􀋗􀋘 􀋙􀋚 􀋛􀋜 􀋝􀋞 􀋡􀋢 􀋣􀋤 􀋥􀋦 􀋧􀋨 􀋩􀋪 􀘳􀘴 􀋭􀋮 􀋯􀋰 􀌋􀌌 􀌍􀌎 􀌏􀌐 􀌑􀌒 􀌓􀌔 􀒞􀒟 􀘿􀙀 􀙳􀙴 􀙵􀙶 􀙷􀙸 􀙹􀙺 􀌕􀌖 􀌗􀌘 􀌚􀌛 􀌜􀌝 􀌞􀌟 􀌠􀌡 􀌢􀌣 􀝁􀝂 􀌤􀌥 􀌦􀌧 􀌨􀌩 􀌪􀌫 􀌬􀌭 􀌮􀌯 􀌰􀌱 􀌲􀌳 􀌴􀌵 􀌶􀌷 􀕺􀕻 􀌸􀌹 􀌼􀌽 􀒤􀘲 􀌾􀌿 􀒥􀒦 􀖎􀖏 􀍀􀍁 􀍂􀍃 􀍄􀍅 􀍆􀍇 􀒧􀒨 􀍈􀙰 􀍉􀍊 􀍋􀍌 􀍍􀍎 􀜮􀜯 􀍏􀍐 􀍑􀍒 􀍓􀍔 􀍕􀍖 􀍗􀍘 􀍙􀍚 􀍛􀍜 􀍡􀍢 􀍣􀍤 􀍥􀍦 􀍧􀍨 􀍩􀍪 􀍫􀍬 􀍭􀍮 􀍯􀍰 􀍺􀍻 􀝎􀝏 􀎐􀎑 􀎒􀎓 􀎔􀎕 􀎖􀙄 􀙅􀎗 􀎘􀎙 􀎚􀎛 􀎜􀎝 􀎞􀎟 􀒼􀒽 􀎠􀎡 􀒲􀒳 􀎢􀎣 􀎤􀎥 􀎦􀎧 􀒴􀒵 􀎨􀎩 􀜇􀜈 􀙊􀙋 􀎬􀎭 􀎮􀎯 􀎰􀎱 􀑠􀎲 􀒶􀎳 􀎴􀎵 􀒷􀙘 􀙙􀙩 􀙪􀓎 􀓏􀓐 􀓑􀎶 􀎷􀝐 􀝑􀎸 􀙌􀎿 􀏀􀏃 􀏄􀏅 􀏆􀏇 􀏈􀏉 􀏊􀏋 􀏌􀏍 􀏎􀏏 􀏐􀏕 􀏖􀏗 􀏘􀏟 􀕸􀏠 􀘜􀕰 􀕱􀕮 􀕯􀕴 􀕵􀏢 􀘮􀏣 􀏤􀏥 􀏦􀏧 􀏨􀏩 􀏪􀏫 􀏬􀑯 􀑰􀏭 􀏮􀏱 􀏲􀏳 􀏴􀏹 􀏺􀏻 􀏼􀓥 􀓦􀐅 􀐆􀐇 􀐈􀐉 􀐊􀐋 􀐌􀐏 􀐐􀐑 􀐒􀐕 􀐖􀙦 􀙧􀞡 􀞢􀞙 􀞚􀞛 􀞜􀞝 􀞞􀞟 􀞠􀝝 􀝞􀐘 􀐙􀐚 􀐛􀐜 􀐝􀐞 􀐟􀙒 􀙓􀐫 􀐬􀐭 􀐮􀐯 􀐰􀛸 􀛹􀉻 􀉼􀉽 􀉾􀉿 􀊀􀊁 􀊂􀖓 􀖔􀙽 􀙾􀙿 􀐾􀐿 􀑀􀜋 􀑂􀘞 􀞈􀞉 􀑆􀑇 􀑉􀑊 􀑋􀑌 􀑍􀑎 􀑏􀑐 􀑑􀑒 􀚑􀚒 􀘯􀘰 􀒉􀒊 􀒗􀒘 􀒙􀒚 􀞖􀞏 􀞒􀞓 􀓘􀘟 􀛭􀛮 􀞃􀞄 􀌈􀌉 􀝧􀝨 􀅴􀅵 􀁜􀁝 􀃬􀃭 􀄢􀄣 􀁞􀁟 􀃮􀃯 􀁌􀁍 􀃜􀃝 􀁎􀁏 􀃞􀃟 􀍶􀘝 􀁐􀁑 􀃠􀃡 􀁒􀁓 􀃢􀃣 􀁔􀁕 􀃤􀃥 􀁘􀁙 􀃦􀃧 􀁖􀁗 􀃨􀃩 􀁚􀁛 􀃪􀃫 􀁠􀁡 􀃰􀃱 􀁢􀁣 􀃲􀃳 􀁮􀁯 􀃾􀃿 􀁰􀁱 􀄀􀄁 􀁲􀁳 􀄂􀄃 􀁴􀁵 􀄄􀄅 􀁶􀁷 􀄆􀄇 􀁸􀁹 􀄈􀄉 􀁺􀁻 􀄊􀄋 􀁼􀁽 􀄌􀄍 􀂂􀂃 􀄒􀄓 􀂄􀂅 􀄔􀄕 􀂆􀂇 􀄖􀄗 􀂈􀂉 􀄘􀄙 􀁾􀁿 􀄎􀄏 􀂀􀂁 􀄐􀄑 􀂊􀂋 􀄚􀄛 􀂌􀂍 􀄜􀄝 􀂎􀂏 􀄞􀄟 􀂐􀂑 􀄠􀄡 􀑺􀑻 􀑼􀑽 􀑾􀑿 􀒀􀒁 􀚁􀚂 􀚃􀚄 􀖊􀖋 􀙞􀙟 􀓂􀄤 􀁦􀁧 􀃶􀃷 􀓃􀄥 􀁨􀁩 􀃸􀃹 􀓄􀄦 􀁪􀁫 􀃺􀃻 􀓅􀄧 􀁬􀁭 􀃼􀃽 􀛣􀛤 􀝶􀝷 􀀀􀀁 􀍷􀕩 􀕪􀕫 􀕧􀕨 􀕬􀕭 􀀄􀀅 􀀆􀀇 􀀈􀀉 􀀊􀀋 􀀌􀀍 􀀎􀀏 􀀐􀀑 􀀒􀀓 􀀔􀀕 􀀖􀀗 􀀘􀀙 􀀚􀀛 􀀜􀀝 􀀞􀀟 􀀠􀀡 􀀢􀀣 􀀤􀀥 􀀦􀀧 􀀨􀀩 􀀪􀀫 􀀬􀀭 􀀮􀀯 􀀰􀀱 􀀲􀀳 􀀴􀀵 􀀶􀀷 􀖗􀖘 􀖙􀖚 􀖛􀖜 􀖝􀖞 􀖟􀖠 􀖡􀖢 􀖣􀖤 􀖥􀖦 􀖧􀖨 􀖩􀖪 􀖫􀖬 􀖭􀖮 􀖯􀖰 􀖱􀖲 􀖳􀖴 􀖵􀖶 􀖷􀖸 􀖹􀖺 􀖻􀖼 􀖽􀖾 􀖿􀗀 􀗁􀗂 􀗃􀗄 􀗅􀗆 􀗇􀗈 􀗉􀗊 􀗋􀗌 􀗍􀗎 􀗏􀗐 􀗑􀗒 􀗓􀗔 􀗕􀗖 ".split(" ");
const filtered = pairs.filter(d => d.indexOf(p) != -1);
if (filtered.length) {
return filtered[0].replace(p, "");
} else {
return p;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment