Skip to content

Instantly share code, notes, and snippets.

@gitcrtn
Created August 4, 2022 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitcrtn/2bd8a8cf7d200abbd35190352c7b58eb to your computer and use it in GitHub Desktop.
Save gitcrtn/2bd8a8cf7d200abbd35190352c7b58eb to your computer and use it in GitHub Desktop.
Character codes finder for Font Awesome 5
use textwrap::dedent;
pub struct Options {
pub join: bool,
pub upper: bool,
pub help: bool,
pub font: String,
pub search_texts: Vec<String>,
pub remove_texts: Vec<String>,
}
pub fn print_help() {
println!("{}", dedent("
Usage: find-fa TEXTS [OPTIONS]
Texts:
keywords for searching characters.
-keyword is ignored from searching targets.
example) find-fa human car music -down
Options:
--join Join character codes with comma as delimiter.
--upper Convert character codes to upper case.
--font=[FONT] Specify font type from Solid, Regular or Brands.
--help Show this help."));
}
fn parse_font_type(arg: String) -> String {
let font = arg.replace("--font=", "").to_lowercase();
let first = &font[0..1];
let mut adjusted = first.to_uppercase();
adjusted.push_str(&font[1..font.len()]);
adjusted
}
pub fn parse_options(args: Vec<String>) -> Options {
let mut search_texts = Vec::new();
let mut remove_texts = Vec::new();
let mut join = false;
let mut upper = false;
let mut help = false;
let mut font = "".to_string();
for arg in args.iter() {
if arg.starts_with("--") {
if arg.starts_with("--font=") {
font = parse_font_type(arg.clone());
continue;
}
match &*arg.clone() {
"--join" => join = true,
"--upper" => upper = true,
"--help" => help = true,
_ => {}
};
} else if arg.starts_with("-") {
if arg.len() == 1 {
continue;
}
remove_texts.push((&arg[1..arg.len()]).to_string());
} else {
search_texts.push(arg.clone());
}
}
Options {
join,
upper,
help,
font,
search_texts,
remove_texts,
}
}
[package]
name = "find-fa"
version = "0.1.0"
edition = "2021"
[dependencies]
lazy_static = "1.4.0"
textwrap = "0.15.0"
use std::collections::HashSet;
use std::fmt;
use std::fmt::Display;
mod fa_context {
use std::collections::HashMap;
use lazy_static::lazy_static;
lazy_static! {
pub static ref CHARACTERS: HashMap<String, HashMap<String, String>> = {
let solid: HashMap<String, String> = [
("ad", "f641"),
("address-book", "f2b9"),
("address-card", "f2bb"),
("adjust", "f042"),
("air-freshener", "f5d0"),
("align-center", "f037"),
("align-justify", "f039"),
("align-left", "f036"),
("align-right", "f038"),
("allergies", "f461"),
("ambulance", "f0f9"),
("american-sign-language-interpreting", "f2a3"),
("anchor", "f13d"),
("angle-double-down", "f103"),
("angle-double-left", "f100"),
("angle-double-right", "f101"),
("angle-double-up", "f102"),
("angle-down", "f107"),
("angle-left", "f104"),
("angle-right", "f105"),
("angle-up", "f106"),
("angry", "f556"),
("ankh", "f644"),
("apple-alt", "f5d1"),
("archive", "f187"),
("archway", "f557"),
("arrow-alt-circle-down", "f358"),
("arrow-alt-circle-left", "f359"),
("arrow-alt-circle-right", "f35a"),
("arrow-alt-circle-up", "f35b"),
("arrow-circle-down", "f0ab"),
("arrow-circle-left", "f0a8"),
("arrow-circle-right", "f0a9"),
("arrow-circle-up", "f0aa"),
("arrow-down", "f063"),
("arrow-left", "f060"),
("arrow-right", "f061"),
("arrow-up", "f062"),
("arrows-alt", "f0b2"),
("arrows-alt-h", "f337"),
("arrows-alt-v", "f338"),
("assistive-listening-systems", "f2a2"),
("asterisk", "f069"),
("at", "f1fa"),
("atlas", "f558"),
("atom", "f5d2"),
("audio-description", "f29e"),
("award", "f559"),
("baby", "f77c"),
("baby-carriage", "f77d"),
("backspace", "f55a"),
("backward", "f04a"),
("bacon", "f7e5"),
("bacteria", "e059"),
("bacterium", "e05a"),
("bahai", "f666"),
("balance-scale", "f24e"),
("balance-scale-left", "f515"),
("balance-scale-right", "f516"),
("ban", "f05e"),
("band-aid", "f462"),
("barcode", "f02a"),
("bars", "f0c9"),
("baseball-ball", "f433"),
("basketball-ball", "f434"),
("bath", "f2cd"),
("battery-empty", "f244"),
("battery-full", "f240"),
("battery-half", "f242"),
("battery-quarter", "f243"),
("battery-three-quarters", "f241"),
("bed", "f236"),
("beer", "f0fc"),
("bell", "f0f3"),
("bell-slash", "f1f6"),
("bezier-curve", "f55b"),
("bible", "f647"),
("bicycle", "f206"),
("biking", "f84a"),
("binoculars", "f1e5"),
("biohazard", "f780"),
("birthday-cake", "f1fd"),
("blender", "f517"),
("blender-phone", "f6b6"),
("blind", "f29d"),
("blog", "f781"),
("bold", "f032"),
("bolt", "f0e7"),
("bomb", "f1e2"),
("bone", "f5d7"),
("bong", "f55c"),
("book", "f02d"),
("book-dead", "f6b7"),
("book-medical", "f7e6"),
("book-open", "f518"),
("book-reader", "f5da"),
("bookmark", "f02e"),
("border-all", "f84c"),
("border-none", "f850"),
("border-style", "f853"),
("bowling-ball", "f436"),
("box", "f466"),
("box-open", "f49e"),
("box-tissue", "e05b"),
("boxes", "f468"),
("braille", "f2a1"),
("brain", "f5dc"),
("bread-slice", "f7ec"),
("briefcase", "f0b1"),
("briefcase-medical", "f469"),
("broadcast-tower", "f519"),
("broom", "f51a"),
("brush", "f55d"),
("bug", "f188"),
("building", "f1ad"),
("bullhorn", "f0a1"),
("bullseye", "f140"),
("burn", "f46a"),
("bus", "f207"),
("bus-alt", "f55e"),
("business-time", "f64a"),
("calculator", "f1ec"),
("calendar", "f133"),
("calendar-alt", "f073"),
("calendar-check", "f274"),
("calendar-day", "f783"),
("calendar-minus", "f272"),
("calendar-plus", "f271"),
("calendar-times", "f273"),
("calendar-week", "f784"),
("camera", "f030"),
("camera-retro", "f083"),
("campground", "f6bb"),
("candy-cane", "f786"),
("cannabis", "f55f"),
("capsules", "f46b"),
("car", "f1b9"),
("car-alt", "f5de"),
("car-battery", "f5df"),
("car-crash", "f5e1"),
("car-side", "f5e4"),
("caravan", "f8ff"),
("caret-down", "f0d7"),
("caret-left", "f0d9"),
("caret-right", "f0da"),
("caret-square-down", "f150"),
("caret-square-left", "f191"),
("caret-square-right", "f152"),
("caret-square-up", "f151"),
("caret-up", "f0d8"),
("carrot", "f787"),
("cart-arrow-down", "f218"),
("cart-plus", "f217"),
("cash-register", "f788"),
("cat", "f6be"),
("certificate", "f0a3"),
("chair", "f6c0"),
("chalkboard", "f51b"),
("chalkboard-teacher", "f51c"),
("charging-station", "f5e7"),
("chart-area", "f1fe"),
("chart-bar", "f080"),
("chart-line", "f201"),
("chart-pie", "f200"),
("check", "f00c"),
("check-circle", "f058"),
("check-double", "f560"),
("check-square", "f14a"),
("cheese", "f7ef"),
("chess", "f439"),
("chess-bishop", "f43a"),
("chess-board", "f43c"),
("chess-king", "f43f"),
("chess-knight", "f441"),
("chess-pawn", "f443"),
("chess-queen", "f445"),
("chess-rook", "f447"),
("chevron-circle-down", "f13a"),
("chevron-circle-left", "f137"),
("chevron-circle-right", "f138"),
("chevron-circle-up", "f139"),
("chevron-down", "f078"),
("chevron-left", "f053"),
("chevron-right", "f054"),
("chevron-up", "f077"),
("child", "f1ae"),
("church", "f51d"),
("circle", "f111"),
("circle-notch", "f1ce"),
("city", "f64f"),
("clinic-medical", "f7f2"),
("clipboard", "f328"),
("clipboard-check", "f46c"),
("clipboard-list", "f46d"),
("clock", "f017"),
("clone", "f24d"),
("closed-captioning", "f20a"),
("cloud", "f0c2"),
("cloud-download-alt", "f381"),
("cloud-meatball", "f73b"),
("cloud-moon", "f6c3"),
("cloud-moon-rain", "f73c"),
("cloud-rain", "f73d"),
("cloud-showers-heavy", "f740"),
("cloud-sun", "f6c4"),
("cloud-sun-rain", "f743"),
("cloud-upload-alt", "f382"),
("cocktail", "f561"),
("code", "f121"),
("code-branch", "f126"),
("coffee", "f0f4"),
("cog", "f013"),
("cogs", "f085"),
("coins", "f51e"),
("columns", "f0db"),
("comment", "f075"),
("comment-alt", "f27a"),
("comment-dollar", "f651"),
("comment-dots", "f4ad"),
("comment-medical", "f7f5"),
("comment-slash", "f4b3"),
("comments", "f086"),
("comments-dollar", "f653"),
("compact-disc", "f51f"),
("compass", "f14e"),
("compress", "f066"),
("compress-alt", "f422"),
("compress-arrows-alt", "f78c"),
("concierge-bell", "f562"),
("cookie", "f563"),
("cookie-bite", "f564"),
("copy", "f0c5"),
("copyright", "f1f9"),
("couch", "f4b8"),
("credit-card", "f09d"),
("crop", "f125"),
("crop-alt", "f565"),
("cross", "f654"),
("crosshairs", "f05b"),
("crow", "f520"),
("crown", "f521"),
("crutch", "f7f7"),
("cube", "f1b2"),
("cubes", "f1b3"),
("cut", "f0c4"),
("database", "f1c0"),
("deaf", "f2a4"),
("democrat", "f747"),
("desktop", "f108"),
("dharmachakra", "f655"),
("diagnoses", "f470"),
("dice", "f522"),
("dice-d20", "f6cf"),
("dice-d6", "f6d1"),
("dice-five", "f523"),
("dice-four", "f524"),
("dice-one", "f525"),
("dice-six", "f526"),
("dice-three", "f527"),
("dice-two", "f528"),
("digital-tachograph", "f566"),
("directions", "f5eb"),
("disease", "f7fa"),
("divide", "f529"),
("dizzy", "f567"),
("dna", "f471"),
("dog", "f6d3"),
("dollar-sign", "f155"),
("dolly", "f472"),
("dolly-flatbed", "f474"),
("donate", "f4b9"),
("door-closed", "f52a"),
("door-open", "f52b"),
("dot-circle", "f192"),
("dove", "f4ba"),
("download", "f019"),
("drafting-compass", "f568"),
("dragon", "f6d5"),
("draw-polygon", "f5ee"),
("drum", "f569"),
("drum-steelpan", "f56a"),
("drumstick-bite", "f6d7"),
("dumbbell", "f44b"),
("dumpster", "f793"),
("dumpster-fire", "f794"),
("dungeon", "f6d9"),
("edit", "f044"),
("egg", "f7fb"),
("eject", "f052"),
("ellipsis-h", "f141"),
("ellipsis-v", "f142"),
("envelope", "f0e0"),
("envelope-open", "f2b6"),
("envelope-open-text", "f658"),
("envelope-square", "f199"),
("equals", "f52c"),
("eraser", "f12d"),
("ethernet", "f796"),
("euro-sign", "f153"),
("exchange-alt", "f362"),
("exclamation", "f12a"),
("exclamation-circle", "f06a"),
("exclamation-triangle", "f071"),
("expand", "f065"),
("expand-alt", "f424"),
("expand-arrows-alt", "f31e"),
("external-link-alt", "f35d"),
("external-link-square-alt", "f360"),
("eye", "f06e"),
("eye-dropper", "f1fb"),
("eye-slash", "f070"),
("fan", "f863"),
("fast-backward", "f049"),
("fast-forward", "f050"),
("faucet", "e005"),
("fax", "f1ac"),
("feather", "f52d"),
("feather-alt", "f56b"),
("female", "f182"),
("fighter-jet", "f0fb"),
("file", "f15b"),
("file-alt", "f15c"),
("file-archive", "f1c6"),
("file-audio", "f1c7"),
("file-code", "f1c9"),
("file-contract", "f56c"),
("file-csv", "f6dd"),
("file-download", "f56d"),
("file-excel", "f1c3"),
("file-export", "f56e"),
("file-image", "f1c5"),
("file-import", "f56f"),
("file-invoice", "f570"),
("file-invoice-dollar", "f571"),
("file-medical", "f477"),
("file-medical-alt", "f478"),
("file-pdf", "f1c1"),
("file-powerpoint", "f1c4"),
("file-prescription", "f572"),
("file-signature", "f573"),
("file-upload", "f574"),
("file-video", "f1c8"),
("file-word", "f1c2"),
("fill", "f575"),
("fill-drip", "f576"),
("film", "f008"),
("filter", "f0b0"),
("fingerprint", "f577"),
("fire", "f06d"),
("fire-alt", "f7e4"),
("fire-extinguisher", "f134"),
("first-aid", "f479"),
("fish", "f578"),
("fist-raised", "f6de"),
("flag", "f024"),
("flag-checkered", "f11e"),
("flag-usa", "f74d"),
("flask", "f0c3"),
("flushed", "f579"),
("folder", "f07b"),
("folder-minus", "f65d"),
("folder-open", "f07c"),
("folder-plus", "f65e"),
("font", "f031"),
("football-ball", "f44e"),
("forward", "f04e"),
("frog", "f52e"),
("frown", "f119"),
("frown-open", "f57a"),
("funnel-dollar", "f662"),
("futbol", "f1e3"),
("gamepad", "f11b"),
("gas-pump", "f52f"),
("gavel", "f0e3"),
("gem", "f3a5"),
("genderless", "f22d"),
("ghost", "f6e2"),
("gift", "f06b"),
("gifts", "f79c"),
("glass-cheers", "f79f"),
("glass-martini", "f000"),
("glass-martini-alt", "f57b"),
("glass-whiskey", "f7a0"),
("glasses", "f530"),
("globe", "f0ac"),
("globe-africa", "f57c"),
("globe-americas", "f57d"),
("globe-asia", "f57e"),
("globe-europe", "f7a2"),
("golf-ball", "f450"),
("gopuram", "f664"),
("graduation-cap", "f19d"),
("greater-than", "f531"),
("greater-than-equal", "f532"),
("grimace", "f57f"),
("grin", "f580"),
("grin-alt", "f581"),
("grin-beam", "f582"),
("grin-beam-sweat", "f583"),
("grin-hearts", "f584"),
("grin-squint", "f585"),
("grin-squint-tears", "f586"),
("grin-stars", "f587"),
("grin-tears", "f588"),
("grin-tongue", "f589"),
("grin-tongue-squint", "f58a"),
("grin-tongue-wink", "f58b"),
("grin-wink", "f58c"),
("grip-horizontal", "f58d"),
("grip-lines", "f7a4"),
("grip-lines-vertical", "f7a5"),
("grip-vertical", "f58e"),
("guitar", "f7a6"),
("h-square", "f0fd"),
("hamburger", "f805"),
("hammer", "f6e3"),
("hamsa", "f665"),
("hand-holding", "f4bd"),
("hand-holding-heart", "f4be"),
("hand-holding-medical", "e05c"),
("hand-holding-usd", "f4c0"),
("hand-holding-water", "f4c1"),
("hand-lizard", "f258"),
("hand-middle-finger", "f806"),
("hand-paper", "f256"),
("hand-peace", "f25b"),
("hand-point-down", "f0a7"),
("hand-point-left", "f0a5"),
("hand-point-right", "f0a4"),
("hand-point-up", "f0a6"),
("hand-pointer", "f25a"),
("hand-rock", "f255"),
("hand-scissors", "f257"),
("hand-sparkles", "e05d"),
("hand-spock", "f259"),
("hands", "f4c2"),
("hands-helping", "f4c4"),
("hands-wash", "e05e"),
("handshake", "f2b5"),
("handshake-alt-slash", "e05f"),
("handshake-slash", "e060"),
("hanukiah", "f6e6"),
("hard-hat", "f807"),
("hashtag", "f292"),
("hat-cowboy", "f8c0"),
("hat-cowboy-side", "f8c1"),
("hat-wizard", "f6e8"),
("hdd", "f0a0"),
("head-side-cough", "e061"),
("head-side-cough-slash", "e062"),
("head-side-mask", "e063"),
("head-side-virus", "e064"),
("heading", "f1dc"),
("headphones", "f025"),
("headphones-alt", "f58f"),
("headset", "f590"),
("heart", "f004"),
("heart-broken", "f7a9"),
("heartbeat", "f21e"),
("helicopter", "f533"),
("highlighter", "f591"),
("hiking", "f6ec"),
("hippo", "f6ed"),
("history", "f1da"),
("hockey-puck", "f453"),
("holly-berry", "f7aa"),
("home", "f015"),
("horse", "f6f0"),
("horse-head", "f7ab"),
("hospital", "f0f8"),
("hospital-alt", "f47d"),
("hospital-symbol", "f47e"),
("hospital-user", "f80d"),
("hot-tub", "f593"),
("hotdog", "f80f"),
("hotel", "f594"),
("hourglass", "f254"),
("hourglass-end", "f253"),
("hourglass-half", "f252"),
("hourglass-start", "f251"),
("house-damage", "f6f1"),
("house-user", "e065"),
("hryvnia", "f6f2"),
("i-cursor", "f246"),
("ice-cream", "f810"),
("icicles", "f7ad"),
("icons", "f86d"),
("id-badge", "f2c1"),
("id-card", "f2c2"),
("id-card-alt", "f47f"),
("igloo", "f7ae"),
("image", "f03e"),
("images", "f302"),
("inbox", "f01c"),
("indent", "f03c"),
("industry", "f275"),
("infinity", "f534"),
("info", "f129"),
("info-circle", "f05a"),
("italic", "f033"),
("jedi", "f669"),
("joint", "f595"),
("journal-whills", "f66a"),
("kaaba", "f66b"),
("key", "f084"),
("keyboard", "f11c"),
("khanda", "f66d"),
("kiss", "f596"),
("kiss-beam", "f597"),
("kiss-wink-heart", "f598"),
("kiwi-bird", "f535"),
("landmark", "f66f"),
("language", "f1ab"),
("laptop", "f109"),
("laptop-code", "f5fc"),
("laptop-house", "e066"),
("laptop-medical", "f812"),
("laugh", "f599"),
("laugh-beam", "f59a"),
("laugh-squint", "f59b"),
("laugh-wink", "f59c"),
("layer-group", "f5fd"),
("leaf", "f06c"),
("lemon", "f094"),
("less-than", "f536"),
("less-than-equal", "f537"),
("level-down-alt", "f3be"),
("level-up-alt", "f3bf"),
("life-ring", "f1cd"),
("lightbulb", "f0eb"),
("link", "f0c1"),
("lira-sign", "f195"),
("list", "f03a"),
("list-alt", "f022"),
("list-ol", "f0cb"),
("list-ul", "f0ca"),
("location-arrow", "f124"),
("lock", "f023"),
("lock-open", "f3c1"),
("long-arrow-alt-down", "f309"),
("long-arrow-alt-left", "f30a"),
("long-arrow-alt-right", "f30b"),
("long-arrow-alt-up", "f30c"),
("low-vision", "f2a8"),
("luggage-cart", "f59d"),
("lungs", "f604"),
("lungs-virus", "e067"),
("magic", "f0d0"),
("magnet", "f076"),
("mail-bulk", "f674"),
("male", "f183"),
("map", "f279"),
("map-marked", "f59f"),
("map-marked-alt", "f5a0"),
("map-marker", "f041"),
("map-marker-alt", "f3c5"),
("map-pin", "f276"),
("map-signs", "f277"),
("marker", "f5a1"),
("mars", "f222"),
("mars-double", "f227"),
("mars-stroke", "f229"),
("mars-stroke-h", "f22b"),
("mars-stroke-v", "f22a"),
("mask", "f6fa"),
("medal", "f5a2"),
("medkit", "f0fa"),
("meh", "f11a"),
("meh-blank", "f5a4"),
("meh-rolling-eyes", "f5a5"),
("memory", "f538"),
("menorah", "f676"),
("mercury", "f223"),
("meteor", "f753"),
("microchip", "f2db"),
("microphone", "f130"),
("microphone-alt", "f3c9"),
("microphone-alt-slash", "f539"),
("microphone-slash", "f131"),
("microscope", "f610"),
("minus", "f068"),
("minus-circle", "f056"),
("minus-square", "f146"),
("mitten", "f7b5"),
("mobile", "f10b"),
("mobile-alt", "f3cd"),
("money-bill", "f0d6"),
("money-bill-alt", "f3d1"),
("money-bill-wave", "f53a"),
("money-bill-wave-alt", "f53b"),
("money-check", "f53c"),
("money-check-alt", "f53d"),
("monument", "f5a6"),
("moon", "f186"),
("mortar-pestle", "f5a7"),
("mosque", "f678"),
("motorcycle", "f21c"),
("mountain", "f6fc"),
("mouse", "f8cc"),
("mouse-pointer", "f245"),
("mug-hot", "f7b6"),
("music", "f001"),
("network-wired", "f6ff"),
("neuter", "f22c"),
("newspaper", "f1ea"),
("not-equal", "f53e"),
("notes-medical", "f481"),
("object-group", "f247"),
("object-ungroup", "f248"),
("oil-can", "f613"),
("om", "f679"),
("otter", "f700"),
("outdent", "f03b"),
("pager", "f815"),
("paint-brush", "f1fc"),
("paint-roller", "f5aa"),
("palette", "f53f"),
("pallet", "f482"),
("paper-plane", "f1d8"),
("paperclip", "f0c6"),
("parachute-box", "f4cd"),
("paragraph", "f1dd"),
("parking", "f540"),
("passport", "f5ab"),
("pastafarianism", "f67b"),
("paste", "f0ea"),
("pause", "f04c"),
("pause-circle", "f28b"),
("paw", "f1b0"),
("peace", "f67c"),
("pen", "f304"),
("pen-alt", "f305"),
("pen-fancy", "f5ac"),
("pen-nib", "f5ad"),
("pen-square", "f14b"),
("pencil-alt", "f303"),
("pencil-ruler", "f5ae"),
("people-arrows", "e068"),
("people-carry", "f4ce"),
("pepper-hot", "f816"),
("percent", "f295"),
("percentage", "f541"),
("person-booth", "f756"),
("phone", "f095"),
("phone-alt", "f879"),
("phone-slash", "f3dd"),
("phone-square", "f098"),
("phone-square-alt", "f87b"),
("phone-volume", "f2a0"),
("photo-video", "f87c"),
("piggy-bank", "f4d3"),
("pills", "f484"),
("pizza-slice", "f818"),
("place-of-worship", "f67f"),
("plane", "f072"),
("plane-arrival", "f5af"),
("plane-departure", "f5b0"),
("plane-slash", "e069"),
("play", "f04b"),
("play-circle", "f144"),
("plug", "f1e6"),
("plus", "f067"),
("plus-circle", "f055"),
("plus-square", "f0fe"),
("podcast", "f2ce"),
("poll", "f681"),
("poll-h", "f682"),
("poo", "f2fe"),
("poo-storm", "f75a"),
("poop", "f619"),
("portrait", "f3e0"),
("pound-sign", "f154"),
("power-off", "f011"),
("pray", "f683"),
("praying-hands", "f684"),
("prescription", "f5b1"),
("prescription-bottle", "f485"),
("prescription-bottle-alt", "f486"),
("print", "f02f"),
("procedures", "f487"),
("project-diagram", "f542"),
("pump-medical", "e06a"),
("pump-soap", "e06b"),
("puzzle-piece", "f12e"),
("qrcode", "f029"),
("question", "f128"),
("question-circle", "f059"),
("quidditch", "f458"),
("quote-left", "f10d"),
("quote-right", "f10e"),
("quran", "f687"),
("radiation", "f7b9"),
("radiation-alt", "f7ba"),
("rainbow", "f75b"),
("random", "f074"),
("receipt", "f543"),
("record-vinyl", "f8d9"),
("recycle", "f1b8"),
("redo", "f01e"),
("redo-alt", "f2f9"),
("registered", "f25d"),
("remove-format", "f87d"),
("reply", "f3e5"),
("reply-all", "f122"),
("republican", "f75e"),
("restroom", "f7bd"),
("retweet", "f079"),
("ribbon", "f4d6"),
("ring", "f70b"),
("road", "f018"),
("robot", "f544"),
("rocket", "f135"),
("route", "f4d7"),
("rss", "f09e"),
("rss-square", "f143"),
("ruble-sign", "f158"),
("ruler", "f545"),
("ruler-combined", "f546"),
("ruler-horizontal", "f547"),
("ruler-vertical", "f548"),
("running", "f70c"),
("rupee-sign", "f156"),
("sad-cry", "f5b3"),
("sad-tear", "f5b4"),
("satellite", "f7bf"),
("satellite-dish", "f7c0"),
("save", "f0c7"),
("school", "f549"),
("screwdriver", "f54a"),
("scroll", "f70e"),
("sd-card", "f7c2"),
("search", "f002"),
("search-dollar", "f688"),
("search-location", "f689"),
("search-minus", "f010"),
("search-plus", "f00e"),
("seedling", "f4d8"),
("server", "f233"),
("shapes", "f61f"),
("share", "f064"),
("share-alt", "f1e0"),
("share-alt-square", "f1e1"),
("share-square", "f14d"),
("shekel-sign", "f20b"),
("shield-alt", "f3ed"),
("shield-virus", "e06c"),
("ship", "f21a"),
("shipping-fast", "f48b"),
("shoe-prints", "f54b"),
("shopping-bag", "f290"),
("shopping-basket", "f291"),
("shopping-cart", "f07a"),
("shower", "f2cc"),
("shuttle-van", "f5b6"),
("sign", "f4d9"),
("sign-in-alt", "f2f6"),
("sign-language", "f2a7"),
("sign-out-alt", "f2f5"),
("signal", "f012"),
("signature", "f5b7"),
("sim-card", "f7c4"),
("sink", "e06d"),
("sitemap", "f0e8"),
("skating", "f7c5"),
("skiing", "f7c9"),
("skiing-nordic", "f7ca"),
("skull", "f54c"),
("skull-crossbones", "f714"),
("slash", "f715"),
("sleigh", "f7cc"),
("sliders-h", "f1de"),
("smile", "f118"),
("smile-beam", "f5b8"),
("smile-wink", "f4da"),
("smog", "f75f"),
("smoking", "f48d"),
("smoking-ban", "f54d"),
("sms", "f7cd"),
("snowboarding", "f7ce"),
("snowflake", "f2dc"),
("snowman", "f7d0"),
("snowplow", "f7d2"),
("soap", "e06e"),
("socks", "f696"),
("solar-panel", "f5ba"),
("sort", "f0dc"),
("sort-alpha-down", "f15d"),
("sort-alpha-down-alt", "f881"),
("sort-alpha-up", "f15e"),
("sort-alpha-up-alt", "f882"),
("sort-amount-down", "f160"),
("sort-amount-down-alt", "f884"),
("sort-amount-up", "f161"),
("sort-amount-up-alt", "f885"),
("sort-down", "f0dd"),
("sort-numeric-down", "f162"),
("sort-numeric-down-alt", "f886"),
("sort-numeric-up", "f163"),
("sort-numeric-up-alt", "f887"),
("sort-up", "f0de"),
("spa", "f5bb"),
("space-shuttle", "f197"),
("spell-check", "f891"),
("spider", "f717"),
("spinner", "f110"),
("splotch", "f5bc"),
("spray-can", "f5bd"),
("square", "f0c8"),
("square-full", "f45c"),
("square-root-alt", "f698"),
("stamp", "f5bf"),
("star", "f005"),
("star-and-crescent", "f699"),
("star-half", "f089"),
("star-half-alt", "f5c0"),
("star-of-david", "f69a"),
("star-of-life", "f621"),
("step-backward", "f048"),
("step-forward", "f051"),
("stethoscope", "f0f1"),
("sticky-note", "f249"),
("stop", "f04d"),
("stop-circle", "f28d"),
("stopwatch", "f2f2"),
("stopwatch-20", "e06f"),
("store", "f54e"),
("store-alt", "f54f"),
("store-alt-slash", "e070"),
("store-slash", "e071"),
("stream", "f550"),
("street-view", "f21d"),
("strikethrough", "f0cc"),
("stroopwafel", "f551"),
("subscript", "f12c"),
("subway", "f239"),
("suitcase", "f0f2"),
("suitcase-rolling", "f5c1"),
("sun", "f185"),
("superscript", "f12b"),
("surprise", "f5c2"),
("swatchbook", "f5c3"),
("swimmer", "f5c4"),
("swimming-pool", "f5c5"),
("synagogue", "f69b"),
("sync", "f021"),
("sync-alt", "f2f1"),
("syringe", "f48e"),
("table", "f0ce"),
("table-tennis", "f45d"),
("tablet", "f10a"),
("tablet-alt", "f3fa"),
("tablets", "f490"),
("tachometer-alt", "f3fd"),
("tag", "f02b"),
("tags", "f02c"),
("tape", "f4db"),
("tasks", "f0ae"),
("taxi", "f1ba"),
("teeth", "f62e"),
("teeth-open", "f62f"),
("temperature-high", "f769"),
("temperature-low", "f76b"),
("tenge", "f7d7"),
("terminal", "f120"),
("text-height", "f034"),
("text-width", "f035"),
("th", "f00a"),
("th-large", "f009"),
("th-list", "f00b"),
("theater-masks", "f630"),
("thermometer", "f491"),
("thermometer-empty", "f2cb"),
("thermometer-full", "f2c7"),
("thermometer-half", "f2c9"),
("thermometer-quarter", "f2ca"),
("thermometer-three-quarters", "f2c8"),
("thumbs-down", "f165"),
("thumbs-up", "f164"),
("thumbtack", "f08d"),
("ticket-alt", "f3ff"),
("times", "f00d"),
("times-circle", "f057"),
("tint", "f043"),
("tint-slash", "f5c7"),
("tired", "f5c8"),
("toggle-off", "f204"),
("toggle-on", "f205"),
("toilet", "f7d8"),
("toilet-paper", "f71e"),
("toilet-paper-slash", "e072"),
("toolbox", "f552"),
("tools", "f7d9"),
("tooth", "f5c9"),
("torah", "f6a0"),
("torii-gate", "f6a1"),
("tractor", "f722"),
("trademark", "f25c"),
("traffic-light", "f637"),
("trailer", "e041"),
("train", "f238"),
("tram", "f7da"),
("transgender", "f224"),
("transgender-alt", "f225"),
("trash", "f1f8"),
("trash-alt", "f2ed"),
("trash-restore", "f829"),
("trash-restore-alt", "f82a"),
("tree", "f1bb"),
("trophy", "f091"),
("truck", "f0d1"),
("truck-loading", "f4de"),
("truck-monster", "f63b"),
("truck-moving", "f4df"),
("truck-pickup", "f63c"),
("tshirt", "f553"),
("tty", "f1e4"),
("tv", "f26c"),
("umbrella", "f0e9"),
("umbrella-beach", "f5ca"),
("underline", "f0cd"),
("undo", "f0e2"),
("undo-alt", "f2ea"),
("universal-access", "f29a"),
("university", "f19c"),
("unlink", "f127"),
("unlock", "f09c"),
("unlock-alt", "f13e"),
("upload", "f093"),
("user", "f007"),
("user-alt", "f406"),
("user-alt-slash", "f4fa"),
("user-astronaut", "f4fb"),
("user-check", "f4fc"),
("user-circle", "f2bd"),
("user-clock", "f4fd"),
("user-cog", "f4fe"),
("user-edit", "f4ff"),
("user-friends", "f500"),
("user-graduate", "f501"),
("user-injured", "f728"),
("user-lock", "f502"),
("user-md", "f0f0"),
("user-minus", "f503"),
("user-ninja", "f504"),
("user-nurse", "f82f"),
("user-plus", "f234"),
("user-secret", "f21b"),
("user-shield", "f505"),
("user-slash", "f506"),
("user-tag", "f507"),
("user-tie", "f508"),
("user-times", "f235"),
("users", "f0c0"),
("users-cog", "f509"),
("users-slash", "e073"),
("utensil-spoon", "f2e5"),
("utensils", "f2e7"),
("vector-square", "f5cb"),
("venus", "f221"),
("venus-double", "f226"),
("venus-mars", "f228"),
("vest", "e085"),
("vest-patches", "e086"),
("vial", "f492"),
("vials", "f493"),
("video", "f03d"),
("video-slash", "f4e2"),
("vihara", "f6a7"),
("virus", "e074"),
("virus-slash", "e075"),
("viruses", "e076"),
("voicemail", "f897"),
("volleyball-ball", "f45f"),
("volume-down", "f027"),
("volume-mute", "f6a9"),
("volume-off", "f026"),
("volume-up", "f028"),
("vote-yea", "f772"),
("vr-cardboard", "f729"),
("walking", "f554"),
("wallet", "f555"),
("warehouse", "f494"),
("water", "f773"),
("wave-square", "f83e"),
("weight", "f496"),
("weight-hanging", "f5cd"),
("wheelchair", "f193"),
("wifi", "f1eb"),
("wind", "f72e"),
("window-close", "f410"),
("window-maximize", "f2d0"),
("window-minimize", "f2d1"),
("window-restore", "f2d2"),
("wine-bottle", "f72f"),
("wine-glass", "f4e3"),
("wine-glass-alt", "f5ce"),
("won-sign", "f159"),
("wrench", "f0ad"),
("x-ray", "f497"),
("yen-sign", "f157"),
("yin-yang", "f6ad"),
]
.into_iter()
.map(|item| (item.0.to_string(), item.1.to_string()))
.collect();
let regular: HashMap<String, String> = [
("address-book", "f2b9"),
("address-card", "f2bb"),
("angry", "f556"),
("arrow-alt-circle-down", "f358"),
("arrow-alt-circle-left", "f359"),
("arrow-alt-circle-right", "f35a"),
("arrow-alt-circle-up", "f35b"),
("bell", "f0f3"),
("bell-slash", "f1f6"),
("bookmark", "f02e"),
("building", "f1ad"),
("calendar", "f133"),
("calendar-alt", "f073"),
("calendar-check", "f274"),
("calendar-minus", "f272"),
("calendar-plus", "f271"),
("calendar-times", "f273"),
("caret-square-down", "f150"),
("caret-square-left", "f191"),
("caret-square-right", "f152"),
("caret-square-up", "f151"),
("chart-bar", "f080"),
("check-circle", "f058"),
("check-square", "f14a"),
("circle", "f111"),
("clipboard", "f328"),
("clock", "f017"),
("clone", "f24d"),
("closed-captioning", "f20a"),
("comment", "f075"),
("comment-alt", "f27a"),
("comment-dots", "f4ad"),
("comments", "f086"),
("compass", "f14e"),
("copy", "f0c5"),
("copyright", "f1f9"),
("credit-card", "f09d"),
("dizzy", "f567"),
("dot-circle", "f192"),
("edit", "f044"),
("envelope", "f0e0"),
("envelope-open", "f2b6"),
("eye", "f06e"),
("eye-slash", "f070"),
("file", "f15b"),
("file-alt", "f15c"),
("file-archive", "f1c6"),
("file-audio", "f1c7"),
("file-code", "f1c9"),
("file-excel", "f1c3"),
("file-image", "f1c5"),
("file-pdf", "f1c1"),
("file-powerpoint", "f1c4"),
("file-video", "f1c8"),
("file-word", "f1c2"),
("flag", "f024"),
("flushed", "f579"),
("folder", "f07b"),
("folder-open", "f07c"),
("frown", "f119"),
("frown-open", "f57a"),
("futbol", "f1e3"),
("gem", "f3a5"),
("grimace", "f57f"),
("grin", "f580"),
("grin-alt", "f581"),
("grin-beam", "f582"),
("grin-beam-sweat", "f583"),
("grin-hearts", "f584"),
("grin-squint", "f585"),
("grin-squint-tears", "f586"),
("grin-stars", "f587"),
("grin-tears", "f588"),
("grin-tongue", "f589"),
("grin-tongue-squint", "f58a"),
("grin-tongue-wink", "f58b"),
("grin-wink", "f58c"),
("hand-lizard", "f258"),
("hand-paper", "f256"),
("hand-peace", "f25b"),
("hand-point-down", "f0a7"),
("hand-point-left", "f0a5"),
("hand-point-right", "f0a4"),
("hand-point-up", "f0a6"),
("hand-pointer", "f25a"),
("hand-rock", "f255"),
("hand-scissors", "f257"),
("hand-spock", "f259"),
("handshake", "f2b5"),
("hdd", "f0a0"),
("heart", "f004"),
("hospital", "f0f8"),
("hourglass", "f254"),
("id-badge", "f2c1"),
("id-card", "f2c2"),
("image", "f03e"),
("images", "f302"),
("keyboard", "f11c"),
("kiss", "f596"),
("kiss-beam", "f597"),
("kiss-wink-heart", "f598"),
("laugh", "f599"),
("laugh-beam", "f59a"),
("laugh-squint", "f59b"),
("laugh-wink", "f59c"),
("lemon", "f094"),
("life-ring", "f1cd"),
("lightbulb", "f0eb"),
("list-alt", "f022"),
("map", "f279"),
("meh", "f11a"),
("meh-blank", "f5a4"),
("meh-rolling-eyes", "f5a5"),
("minus-square", "f146"),
("money-bill-alt", "f3d1"),
("moon", "f186"),
("newspaper", "f1ea"),
("object-group", "f247"),
("object-ungroup", "f248"),
("paper-plane", "f1d8"),
("pause-circle", "f28b"),
("play-circle", "f144"),
("plus-square", "f0fe"),
("question-circle", "f059"),
("registered", "f25d"),
("sad-cry", "f5b3"),
("sad-tear", "f5b4"),
("save", "f0c7"),
("share-square", "f14d"),
("smile", "f118"),
("smile-beam", "f5b8"),
("smile-wink", "f4da"),
("snowflake", "f2dc"),
("square", "f0c8"),
("star", "f005"),
("star-half", "f089"),
("sticky-note", "f249"),
("stop-circle", "f28d"),
("sun", "f185"),
("surprise", "f5c2"),
("thumbs-down", "f165"),
("thumbs-up", "f164"),
("times-circle", "f057"),
("tired", "f5c8"),
("trash-alt", "f2ed"),
("user", "f007"),
("user-circle", "f2bd"),
("window-close", "f410"),
("window-maximize", "f2d0"),
("window-minimize", "f2d1"),
("window-restore", "f2d2"),
]
.into_iter()
.map(|item| (item.0.to_string(), item.1.to_string()))
.collect();
let brands: HashMap<String, String> = [
("500px", "f26e"),
("accessible-icon", "f368"),
("accusoft", "f369"),
("acquisitions-incorporated", "f6af"),
("adn", "f170"),
("adversal", "f36a"),
("affiliatetheme", "f36b"),
("airbnb", "f834"),
("algolia", "f36c"),
("alipay", "f642"),
("amazon", "f270"),
("amazon-pay", "f42c"),
("amilia", "f36d"),
("android", "f17b"),
("angellist", "f209"),
("angrycreative", "f36e"),
("angular", "f420"),
("app-store", "f36f"),
("app-store-ios", "f370"),
("apper", "f371"),
("apple", "f179"),
("apple-pay", "f415"),
("artstation", "f77a"),
("asymmetrik", "f372"),
("atlassian", "f77b"),
("audible", "f373"),
("autoprefixer", "f41c"),
("avianex", "f374"),
("aviato", "f421"),
("aws", "f375"),
("bandcamp", "f2d5"),
("battle-net", "f835"),
("behance", "f1b4"),
("behance-square", "f1b5"),
("bimobject", "f378"),
("bitbucket", "f171"),
("bitcoin", "f379"),
("bity", "f37a"),
("black-tie", "f27e"),
("blackberry", "f37b"),
("blogger", "f37c"),
("blogger-b", "f37d"),
("bluetooth", "f293"),
("bluetooth-b", "f294"),
("bootstrap", "f836"),
("btc", "f15a"),
("buffer", "f837"),
("buromobelexperte", "f37f"),
("buy-n-large", "f8a6"),
("buysellads", "f20d"),
("canadian-maple-leaf", "f785"),
("cc-amazon-pay", "f42d"),
("cc-amex", "f1f3"),
("cc-apple-pay", "f416"),
("cc-diners-club", "f24c"),
("cc-discover", "f1f2"),
("cc-jcb", "f24b"),
("cc-mastercard", "f1f1"),
("cc-paypal", "f1f4"),
("cc-stripe", "f1f5"),
("cc-visa", "f1f0"),
("centercode", "f380"),
("centos", "f789"),
("chrome", "f268"),
("chromecast", "f838"),
("cloudflare", "e07d"),
("cloudscale", "f383"),
("cloudsmith", "f384"),
("cloudversify", "f385"),
("codepen", "f1cb"),
("codiepie", "f284"),
("confluence", "f78d"),
("connectdevelop", "f20e"),
("contao", "f26d"),
("cotton-bureau", "f89e"),
("cpanel", "f388"),
("creative-commons", "f25e"),
("creative-commons-by", "f4e7"),
("creative-commons-nc", "f4e8"),
("creative-commons-nc-eu", "f4e9"),
("creative-commons-nc-jp", "f4ea"),
("creative-commons-nd", "f4eb"),
("creative-commons-pd", "f4ec"),
("creative-commons-pd-alt", "f4ed"),
("creative-commons-remix", "f4ee"),
("creative-commons-sa", "f4ef"),
("creative-commons-sampling", "f4f0"),
("creative-commons-sampling-plus", "f4f1"),
("creative-commons-share", "f4f2"),
("creative-commons-zero", "f4f3"),
("critical-role", "f6c9"),
("css3", "f13c"),
("css3-alt", "f38b"),
("cuttlefish", "f38c"),
("d-and-d", "f38d"),
("d-and-d-beyond", "f6ca"),
("dailymotion", "e052"),
("dashcube", "f210"),
("deezer", "e077"),
("delicious", "f1a5"),
("deploydog", "f38e"),
("deskpro", "f38f"),
("dev", "f6cc"),
("deviantart", "f1bd"),
("dhl", "f790"),
("diaspora", "f791"),
("digg", "f1a6"),
("digital-ocean", "f391"),
("discord", "f392"),
("discourse", "f393"),
("dochub", "f394"),
("docker", "f395"),
("draft2digital", "f396"),
("dribbble", "f17d"),
("dribbble-square", "f397"),
("dropbox", "f16b"),
("drupal", "f1a9"),
("dyalog", "f399"),
("earlybirds", "f39a"),
("ebay", "f4f4"),
("edge", "f282"),
("edge-legacy", "e078"),
("elementor", "f430"),
("ello", "f5f1"),
("ember", "f423"),
("empire", "f1d1"),
("envira", "f299"),
("erlang", "f39d"),
("ethereum", "f42e"),
("etsy", "f2d7"),
("evernote", "f839"),
("expeditedssl", "f23e"),
("facebook", "f09a"),
("facebook-f", "f39e"),
("facebook-messenger", "f39f"),
("facebook-square", "f082"),
("fantasy-flight-games", "f6dc"),
("fedex", "f797"),
("fedora", "f798"),
("figma", "f799"),
("firefox", "f269"),
("firefox-browser", "e007"),
("first-order", "f2b0"),
("first-order-alt", "f50a"),
("firstdraft", "f3a1"),
("flickr", "f16e"),
("flipboard", "f44d"),
("fly", "f417"),
("font-awesome", "f2b4"),
("font-awesome-alt", "f35c"),
("font-awesome-flag", "f425"),
("fonticons", "f280"),
("fonticons-fi", "f3a2"),
("fort-awesome", "f286"),
("fort-awesome-alt", "f3a3"),
("forumbee", "f211"),
("foursquare", "f180"),
("free-code-camp", "f2c5"),
("freebsd", "f3a4"),
("fulcrum", "f50b"),
("galactic-republic", "f50c"),
("galactic-senate", "f50d"),
("get-pocket", "f265"),
("gg", "f260"),
("gg-circle", "f261"),
("git", "f1d3"),
("git-alt", "f841"),
("git-square", "f1d2"),
("github", "f09b"),
("github-alt", "f113"),
("github-square", "f092"),
("gitkraken", "f3a6"),
("gitlab", "f296"),
("gitter", "f426"),
("glide", "f2a5"),
("glide-g", "f2a6"),
("gofore", "f3a7"),
("goodreads", "f3a8"),
("goodreads-g", "f3a9"),
("google", "f1a0"),
("google-drive", "f3aa"),
("google-pay", "e079"),
("google-play", "f3ab"),
("google-plus", "f2b3"),
("google-plus-g", "f0d5"),
("google-plus-square", "f0d4"),
("google-wallet", "f1ee"),
("gratipay", "f184"),
("grav", "f2d6"),
("gripfire", "f3ac"),
("grunt", "f3ad"),
("guilded", "e07e"),
("gulp", "f3ae"),
("hacker-news", "f1d4"),
("hacker-news-square", "f3af"),
("hackerrank", "f5f7"),
("hips", "f452"),
("hire-a-helper", "f3b0"),
("hive", "e07f"),
("hooli", "f427"),
("hornbill", "f592"),
("hotjar", "f3b1"),
("houzz", "f27c"),
("html5", "f13b"),
("hubspot", "f3b2"),
("ideal", "e013"),
("imdb", "f2d8"),
("innosoft", "e080"),
("instagram", "f16d"),
("instagram-square", "e055"),
("instalod", "e081"),
("intercom", "f7af"),
("internet-explorer", "f26b"),
("invision", "f7b0"),
("ioxhost", "f208"),
("itch-io", "f83a"),
("itunes", "f3b4"),
("itunes-note", "f3b5"),
("java", "f4e4"),
("jedi-order", "f50e"),
("jenkins", "f3b6"),
("jira", "f7b1"),
("joget", "f3b7"),
("joomla", "f1aa"),
("js", "f3b8"),
("js-square", "f3b9"),
("jsfiddle", "f1cc"),
("kaggle", "f5fa"),
("keybase", "f4f5"),
("keycdn", "f3ba"),
("kickstarter", "f3bb"),
("kickstarter-k", "f3bc"),
("korvue", "f42f"),
("laravel", "f3bd"),
("lastfm", "f202"),
("lastfm-square", "f203"),
("leanpub", "f212"),
("less", "f41d"),
("line", "f3c0"),
("linkedin", "f08c"),
("linkedin-in", "f0e1"),
("linode", "f2b8"),
("linux", "f17c"),
("lyft", "f3c3"),
("magento", "f3c4"),
("mailchimp", "f59e"),
("mandalorian", "f50f"),
("markdown", "f60f"),
("mastodon", "f4f6"),
("maxcdn", "f136"),
("mdb", "f8ca"),
("medapps", "f3c6"),
("medium", "f23a"),
("medium-m", "f3c7"),
("medrt", "f3c8"),
("meetup", "f2e0"),
("megaport", "f5a3"),
("mendeley", "f7b3"),
("microblog", "e01a"),
("microsoft", "f3ca"),
("mix", "f3cb"),
("mixcloud", "f289"),
("mixer", "e056"),
("mizuni", "f3cc"),
("modx", "f285"),
("monero", "f3d0"),
("napster", "f3d2"),
("neos", "f612"),
("nimblr", "f5a8"),
("node", "f419"),
("node-js", "f3d3"),
("npm", "f3d4"),
("ns8", "f3d5"),
("nutritionix", "f3d6"),
("octopus-deploy", "e082"),
("odnoklassniki", "f263"),
("odnoklassniki-square", "f264"),
("old-republic", "f510"),
("opencart", "f23d"),
("openid", "f19b"),
("opera", "f26a"),
("optin-monster", "f23c"),
("orcid", "f8d2"),
("osi", "f41a"),
("page4", "f3d7"),
("pagelines", "f18c"),
("palfed", "f3d8"),
("patreon", "f3d9"),
("paypal", "f1ed"),
("penny-arcade", "f704"),
("perbyte", "e083"),
("periscope", "f3da"),
("phabricator", "f3db"),
("phoenix-framework", "f3dc"),
("phoenix-squadron", "f511"),
("php", "f457"),
("pied-piper", "f2ae"),
("pied-piper-alt", "f1a8"),
("pied-piper-hat", "f4e5"),
("pied-piper-pp", "f1a7"),
("pied-piper-square", "e01e"),
("pinterest", "f0d2"),
("pinterest-p", "f231"),
("pinterest-square", "f0d3"),
("playstation", "f3df"),
("product-hunt", "f288"),
("pushed", "f3e1"),
("python", "f3e2"),
("qq", "f1d6"),
("quinscape", "f459"),
("quora", "f2c4"),
("r-project", "f4f7"),
("raspberry-pi", "f7bb"),
("ravelry", "f2d9"),
("react", "f41b"),
("reacteurope", "f75d"),
("readme", "f4d5"),
("rebel", "f1d0"),
("red-river", "f3e3"),
("reddit", "f1a1"),
("reddit-alien", "f281"),
("reddit-square", "f1a2"),
("redhat", "f7bc"),
("renren", "f18b"),
("replyd", "f3e6"),
("researchgate", "f4f8"),
("resolving", "f3e7"),
("rev", "f5b2"),
("rocketchat", "f3e8"),
("rockrms", "f3e9"),
("rust", "e07a"),
("safari", "f267"),
("salesforce", "f83b"),
("sass", "f41e"),
("schlix", "f3ea"),
("scribd", "f28a"),
("searchengin", "f3eb"),
("sellcast", "f2da"),
("sellsy", "f213"),
("servicestack", "f3ec"),
("shirtsinbulk", "f214"),
("shopify", "e057"),
("shopware", "f5b5"),
("simplybuilt", "f215"),
("sistrix", "f3ee"),
("sith", "f512"),
("sketch", "f7c6"),
("skyatlas", "f216"),
("skype", "f17e"),
("slack", "f198"),
("slack-hash", "f3ef"),
("slideshare", "f1e7"),
("snapchat", "f2ab"),
("snapchat-ghost", "f2ac"),
("snapchat-square", "f2ad"),
("soundcloud", "f1be"),
("sourcetree", "f7d3"),
("speakap", "f3f3"),
("speaker-deck", "f83c"),
("spotify", "f1bc"),
("squarespace", "f5be"),
("stack-exchange", "f18d"),
("stack-overflow", "f16c"),
("stackpath", "f842"),
("staylinked", "f3f5"),
("steam", "f1b6"),
("steam-square", "f1b7"),
("steam-symbol", "f3f6"),
("sticker-mule", "f3f7"),
("strava", "f428"),
("stripe", "f429"),
("stripe-s", "f42a"),
("studiovinari", "f3f8"),
("stumbleupon", "f1a4"),
("stumbleupon-circle", "f1a3"),
("superpowers", "f2dd"),
("supple", "f3f9"),
("suse", "f7d6"),
("swift", "f8e1"),
("symfony", "f83d"),
("teamspeak", "f4f9"),
("telegram", "f2c6"),
("telegram-plane", "f3fe"),
("tencent-weibo", "f1d5"),
("the-red-yeti", "f69d"),
("themeco", "f5c6"),
("themeisle", "f2b2"),
("think-peaks", "f731"),
("tiktok", "e07b"),
("trade-federation", "f513"),
("trello", "f181"),
("tumblr", "f173"),
("tumblr-square", "f174"),
("twitch", "f1e8"),
("twitter", "f099"),
("twitter-square", "f081"),
("typo3", "f42b"),
("uber", "f402"),
("ubuntu", "f7df"),
("uikit", "f403"),
("umbraco", "f8e8"),
("uncharted", "e084"),
("uniregistry", "f404"),
("unity", "e049"),
("unsplash", "e07c"),
("untappd", "f405"),
("ups", "f7e0"),
("usb", "f287"),
("usps", "f7e1"),
("ussunnah", "f407"),
("vaadin", "f408"),
("viacoin", "f237"),
("viadeo", "f2a9"),
("viadeo-square", "f2aa"),
("viber", "f409"),
("vimeo", "f40a"),
("vimeo-square", "f194"),
("vimeo-v", "f27d"),
("vine", "f1ca"),
("vk", "f189"),
("vnv", "f40b"),
("vuejs", "f41f"),
("watchman-monitoring", "e087"),
("waze", "f83f"),
("weebly", "f5cc"),
("weibo", "f18a"),
("weixin", "f1d7"),
("whatsapp", "f232"),
("whatsapp-square", "f40c"),
("whmcs", "f40d"),
("wikipedia-w", "f266"),
("windows", "f17a"),
("wix", "f5cf"),
("wizards-of-the-coast", "f730"),
("wodu", "e088"),
("wolf-pack-battalion", "f514"),
("wordpress", "f19a"),
("wordpress-simple", "f411"),
("wpbeginner", "f297"),
("wpexplorer", "f2de"),
("wpforms", "f298"),
("wpressr", "f3e4"),
("xbox", "f412"),
("xing", "f168"),
("xing-square", "f169"),
("y-combinator", "f23b"),
("yahoo", "f19e"),
("yammer", "f840"),
("yandex", "f413"),
("yandex-international", "f414"),
("yarn", "f7e3"),
("yelp", "f1e9"),
("yoast", "f2b1"),
("youtube", "f167"),
("youtube-square", "f431"),
("zhihu", "f63f"),
]
.into_iter()
.map(|item| (item.0.to_string(), item.1.to_string()))
.collect();
[
("Solid", solid),
("Regular", regular),
("Brands", brands),
]
.into_iter()
.map(|item| (item.0.to_string(), item.1))
.collect()
};
}
}
#[derive(Eq, Hash, PartialEq)]
pub struct Character {
pub font: String,
pub name: String,
pub code: String,
}
impl Character {
pub fn convert_string(&self, upper: bool) -> String {
if upper {
format!("{}, {}, {}", self.font, self.name, self.code.to_uppercase())
} else {
format!("{}, {}, {}", self.font, self.name, self.code)
}
}
}
impl Display for Character {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str(&self.convert_string(false))?;
Ok(())
}
}
pub fn search_characters(search_texts: Vec<String>, remove_texts: Vec<String>, font_type: String) -> Vec<Character> {
let ref fa_chars = fa_context::CHARACTERS;
let mut chars: HashSet<Character> = HashSet::new();
let empty_font = "".to_string();
for (font, codes) in fa_chars.iter() {
if font_type != empty_font && *font != font_type {
continue;
}
for (name, code) in codes.iter() {
'search: for search_text in search_texts.iter() {
for remove_text in remove_texts.iter() {
if name.contains(remove_text) {
break 'search;
}
}
if name.contains(search_text) {
chars.insert(Character {
font: font.clone(),
name: name.clone(),
code: code.clone(),
});
}
}
}
}
let mut chars: Vec<Character> = chars
.into_iter()
.collect();
chars.sort_by(|a, b| a.to_string().partial_cmp(&b.to_string()).unwrap());
chars
}
mod fa;
mod args;
use std::env;
use crate::args::{parse_options, print_help};
use crate::fa::search_characters;
fn main() {
let mut args: Vec<String> = env::args().collect();
args.remove(0);
let options = parse_options(args);
if options.help || options.search_texts.len() == 0 {
print_help();
return;
}
let chars = search_characters(
options.search_texts,
options.remove_texts,
options.font);
if chars.len() == 0 {
println!("Not found.");
return;
}
if options.join {
let codes = chars
.iter()
.map(|item| item.code.clone())
.collect::<Vec<String>>()
.join(",");
let codes = if options.upper {
codes.to_uppercase()
} else {
codes
};
println!("{}", codes);
return;
}
for chr in chars.iter() {
println!("{}", chr.convert_string(options.upper));
}
}
@gitcrtn
Copy link
Author

gitcrtn commented Aug 4, 2022

command line for generating HashMap items:
cat solid.txt | awk '{print $2,$3}' | sed -e 's/\(.*\) \(.*\)/("\1", "\2"),/g' > solid_items.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment