Improve codegen of Font roblox datatype enums

This commit is contained in:
Filip Tibell 2023-03-17 16:54:13 +01:00
parent d79895dc88
commit 9722f5b862
No known key found for this signature in database
2 changed files with 210 additions and 171 deletions

View file

@ -4,65 +4,90 @@ local contents = ""
contents ..= "\ntype FontData = (&'static str, FontWeight, FontStyle);\n" contents ..= "\ntype FontData = (&'static str, FontWeight, FontStyle);\n"
local ENUM_IMPLEMENTATION = [[
#[derive(Debug, Clone, Copy, PartialEq)]
pub(crate) enum <<ENUM_NAME>> {
<<ENUM_NAMES>>
}
impl <<ENUM_NAME>> {
pub fn as_<<NUMBER_TYPE>>(&self) -> <<NUMBER_TYPE>> {
match self {
<<ENUM_TO_NUMBERS>>
}
}
pub fn from_<<NUMBER_TYPE>>(n: <<NUMBER_TYPE>>) -> Option<Self> {
match n {
<<NUMBERS_TO_ENUM>>
_ => None,
}
}
}
impl std::str::FromStr for <<ENUM_NAME>> {
type Err = &'static str;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
<<STRINGS_TO_ENUM>>
_ => Err("Unknown <<ENUM_NAME>>"),
}
}
}
impl std::fmt::Display for <<ENUM_NAME>> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
<<ENUM_TO_STRINGS>>
}
)
}
}
]]
-- FontWeight enum and implementation -- FontWeight enum and implementation
local function makeRustEnum(enum, numType: string) local function makeRustEnum(enum, numType: string)
local name = string.gsub(tostring(enum), "^Enum.", "") local name = string.gsub(tostring(enum), "^Enum.", "")
-- TODO: Use FromStr and AsStr traits for name functions local enumNames = ""
-- TODO: Match the naming convention that rbx-dom has for number/value functions local enumToNumbers = ""
local numbersToEnum = ""
local stringsToEnum = ""
local enumToStrings = ""
local result = "" for _, enum in enum:GetEnumItems() do
enumNames ..= `\n{enum.Name},`
enumToNumbers ..= `\nSelf::{enum.Name} => {enum.Value},`
numbersToEnum ..= `\n{enum.Value} => Some(Self::{enum.Name}),`
stringsToEnum ..= `\n"{enum.Name}" => Ok(Self::{enum.Name}),`
enumToStrings ..= `\nSelf::{enum.Name} => "{enum.Name}",`
end
result ..= "\n#[derive(Debug, Clone, PartialEq)]" local mappings: { [string]: string } = {
result ..= "\npub(crate) enum " .. name .. " {" ["<<ENUM_NAME>>"] = name,
for _, enum in enum:GetEnumItems() do ["<<NUMBER_TYPE>>"] = numType,
result ..= string.format("\n %s,", enum.Name) ["<<ENUM_NAMES>>"] = enumNames,
end ["<<ENUM_TO_NUMBERS>>"] = enumToNumbers,
result ..= "\n}\n" ["<<ENUM_TO_STRINGS>>"] = enumToStrings,
["<<NUMBERS_TO_ENUM>>"] = numbersToEnum,
["<<STRINGS_TO_ENUM>>"] = stringsToEnum,
}
result ..= "\nimpl " .. name .. " {" local result = ENUM_IMPLEMENTATION
result ..= "\n pub fn into_name(self) -> &'static str {" for key, replacement in mappings do
result ..= "\n match self {" result = string.gsub(result, "(\t*)" .. key, function(tabbing)
for _, enum in enum:GetEnumItems() do local spacing = string.gsub(tabbing, "\t", " ")
result ..= string.format('\n Self::%s => "%s",', enum.Name, enum.Name) local inner = string.gsub(replacement, "\n", "\n" .. spacing)
inner = string.gsub(inner, "^\n+", "")
return inner
end)
end end
result ..= "\n }"
result ..= "\n }"
result ..= "\n"
result ..= "\n pub fn from_name(name: impl AsRef<str>) -> Option<Self> {"
result ..= "\n match name.as_ref() {"
for _, enum in enum:GetEnumItems() do
result ..= string.format('\n "%s" => Some(Self::%s),', enum.Name, enum.Name)
end
result ..= "\n _ => None,"
result ..= "\n }"
result ..= "\n }"
result ..= "\n"
result ..= "\n pub fn into_num(self) -> " .. numType .. " {"
result ..= "\n match self {"
for _, enum in enum:GetEnumItems() do
result ..= string.format("\n Self::%s => %d,", enum.Name, enum.Value)
end
result ..= "\n }"
result ..= "\n }"
result ..= "\n"
result ..= "\n pub fn from_num(num: " .. numType .. ") -> Option<Self> {"
result ..= "\n match num {"
for _, enum in enum:GetEnumItems() do
result ..= string.format("\n %d => Some(Self::%s),", enum.Value, enum.Name)
end
result ..= "\n _ => None,"
result ..= "\n }"
result ..= "\n }"
result ..= "\n}\n"
result ..= "\nimpl fmt::Display for " .. name .. " {"
result ..= "\n fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {"
result ..= '\n write!(f, "{}", self.into_name())'
result ..= "\n }"
result ..= "\n}"
return result return result
end end
@ -74,25 +99,35 @@ contents ..= "\n"
-- Font constant map from enum to font data -- Font constant map from enum to font data
-- TODO: Fix formatting issues of output here
local longestNameLen = 0 local longestNameLen = 0
local longestFamilyLen = 0
local longestWeightLen = 0
for _, enum in Enum.Font:GetEnumItems() do for _, enum in Enum.Font:GetEnumItems() do
longestNameLen = math.max(longestNameLen, #enum.Name) longestNameLen = math.max(longestNameLen, #enum.Name)
if enum ~= Enum.Font.Unknown then
local font = Font.fromEnum(enum)
longestFamilyLen = math.max(longestFamilyLen, #font.Family)
longestWeightLen = math.max(longestWeightLen, #font.Weight.Name)
end
end end
contents ..= "\n#[rustfmt::skip]\nconst FONT_ENUM_MAP: &[(&str, Option<FontData>)] = &[\n" contents ..= "\n#[rustfmt::skip]\nconst FONT_ENUM_MAP: &[(&str, Option<FontData>)] = &[\n"
for _, enum in Enum.Font:GetEnumItems() do for _, enum in Enum.Font:GetEnumItems() do
if enum == Enum.Font.Unknown then if enum == Enum.Font.Unknown then
contents ..= ' ("Unknown", None),\n' contents ..= string.format(
' ("Unknown",%s None),\n',
string.rep(" ", longestNameLen - #enum.Name)
)
else else
local font = Font.fromEnum(enum) local font = Font.fromEnum(enum)
contents ..= string.format( contents ..= string.format(
' ("%s",%s Some(("%s", FontWeight::%s, FontStyle::%s))),\n', ' ("%s",%s Some(("%s",%s FontWeight::%s,%s FontStyle::%s))),\n',
enum.Name, enum.Name,
string.rep(" ", longestNameLen - #enum.Name), string.rep(" ", longestNameLen - #enum.Name),
font.Family, font.Family,
string.rep(" ", longestFamilyLen - #font.Family),
font.Weight.Name, font.Weight.Name,
string.rep(" ", longestWeightLen - #font.Weight.Name),
font.Style.Name font.Style.Name
) )
end end

View file

@ -24,13 +24,11 @@ impl Font {
FONT_ENUM_MAP FONT_ENUM_MAP
.iter() .iter()
.find(|props| props.0 == material_enum_item.name && props.1.is_some()) .find(|props| props.0 == material_enum_item.name && props.1.is_some())
.map(|props| { .map(|props| props.1.as_ref().unwrap())
let props = props.1.as_ref().unwrap().clone(); .map(|props| Font {
Font { family: props.0.to_string(),
family: props.0.to_string(), weight: props.1,
weight: props.1, style: props.2,
style: props.2,
}
}) })
} }
@ -64,7 +62,7 @@ impl LuaUserData for Font {
fn add_fields<'lua, F: LuaUserDataFields<'lua, Self>>(fields: &mut F) { fn add_fields<'lua, F: LuaUserDataFields<'lua, Self>>(fields: &mut F) {
fields.add_field_method_get("Family", |_, this| Ok(this.family.clone())); fields.add_field_method_get("Family", |_, this| Ok(this.family.clone()));
// TODO: Getters & setters for weight, style // TODO: Getters & setters for weight, style
fields.add_field_method_get("Bold", |_, this| Ok(this.weight.clone().into_num() >= 600)); fields.add_field_method_get("Bold", |_, this| Ok(this.weight.clone().as_u16() >= 600));
fields.add_field_method_set("Bold", |_, this, value: bool| { fields.add_field_method_set("Bold", |_, this, value: bool| {
if value { if value {
this.weight = FontWeight::Bold; this.weight = FontWeight::Bold;
@ -110,25 +108,25 @@ impl From<Font> for RbxFont {
impl From<RbxFontWeight> for FontWeight { impl From<RbxFontWeight> for FontWeight {
fn from(v: RbxFontWeight) -> Self { fn from(v: RbxFontWeight) -> Self {
FontWeight::from_num(v.as_u16()).expect("Missing font weight") FontWeight::from_u16(v.as_u16()).expect("Missing font weight")
} }
} }
impl From<FontWeight> for RbxFontWeight { impl From<FontWeight> for RbxFontWeight {
fn from(v: FontWeight) -> Self { fn from(v: FontWeight) -> Self {
RbxFontWeight::from_u16(v.into_num()).expect("Missing rbx font weight") RbxFontWeight::from_u16(v.as_u16()).expect("Missing rbx font weight")
} }
} }
impl From<RbxFontStyle> for FontStyle { impl From<RbxFontStyle> for FontStyle {
fn from(v: RbxFontStyle) -> Self { fn from(v: RbxFontStyle) -> Self {
FontStyle::from_num(v.as_u8()).expect("Missing font weight") FontStyle::from_u8(v.as_u8()).expect("Missing font weight")
} }
} }
impl From<FontStyle> for RbxFontStyle { impl From<FontStyle> for RbxFontStyle {
fn from(v: FontStyle) -> Self { fn from(v: FontStyle) -> Self {
RbxFontStyle::from_u8(v.into_num()).expect("Missing rbx font weight") RbxFontStyle::from_u8(v.as_u8()).expect("Missing rbx font weight")
} }
} }
@ -142,7 +140,7 @@ impl From<FontStyle> for RbxFontStyle {
type FontData = (&'static str, FontWeight, FontStyle); type FontData = (&'static str, FontWeight, FontStyle);
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub(crate) enum FontWeight { pub(crate) enum FontWeight {
Thin, Thin,
ExtraLight, ExtraLight,
@ -156,36 +154,7 @@ pub(crate) enum FontWeight {
} }
impl FontWeight { impl FontWeight {
pub fn into_name(self) -> &'static str { pub fn as_u16(&self) -> u16 {
match self {
Self::Thin => "Thin",
Self::ExtraLight => "ExtraLight",
Self::Light => "Light",
Self::Regular => "Regular",
Self::Medium => "Medium",
Self::SemiBold => "SemiBold",
Self::Bold => "Bold",
Self::ExtraBold => "ExtraBold",
Self::Heavy => "Heavy",
}
}
pub fn from_name(name: impl AsRef<str>) -> Option<Self> {
match name.as_ref() {
"Thin" => Some(Self::Thin),
"ExtraLight" => Some(Self::ExtraLight),
"Light" => Some(Self::Light),
"Regular" => Some(Self::Regular),
"Medium" => Some(Self::Medium),
"SemiBold" => Some(Self::SemiBold),
"Bold" => Some(Self::Bold),
"ExtraBold" => Some(Self::ExtraBold),
"Heavy" => Some(Self::Heavy),
_ => None,
}
}
pub fn into_num(self) -> u16 {
match self { match self {
Self::Thin => 100, Self::Thin => 100,
Self::ExtraLight => 200, Self::ExtraLight => 200,
@ -199,8 +168,8 @@ impl FontWeight {
} }
} }
pub fn from_num(num: u16) -> Option<Self> { pub fn from_u16(n: u16) -> Option<Self> {
match num { match n {
100 => Some(Self::Thin), 100 => Some(Self::Thin),
200 => Some(Self::ExtraLight), 200 => Some(Self::ExtraLight),
300 => Some(Self::Light), 300 => Some(Self::Light),
@ -215,43 +184,60 @@ impl FontWeight {
} }
} }
impl fmt::Display for FontWeight { impl std::str::FromStr for FontWeight {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { type Err = &'static str;
write!(f, "{}", self.clone().into_name()) fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Thin" => Ok(Self::Thin),
"ExtraLight" => Ok(Self::ExtraLight),
"Light" => Ok(Self::Light),
"Regular" => Ok(Self::Regular),
"Medium" => Ok(Self::Medium),
"SemiBold" => Ok(Self::SemiBold),
"Bold" => Ok(Self::Bold),
"ExtraBold" => Ok(Self::ExtraBold),
"Heavy" => Ok(Self::Heavy),
_ => Err("Unknown FontWeight"),
}
} }
} }
#[derive(Debug, Clone, PartialEq)] impl std::fmt::Display for FontWeight {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Thin => "Thin",
Self::ExtraLight => "ExtraLight",
Self::Light => "Light",
Self::Regular => "Regular",
Self::Medium => "Medium",
Self::SemiBold => "SemiBold",
Self::Bold => "Bold",
Self::ExtraBold => "ExtraBold",
Self::Heavy => "Heavy",
}
)
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub(crate) enum FontStyle { pub(crate) enum FontStyle {
Normal, Normal,
Italic, Italic,
} }
impl FontStyle { impl FontStyle {
pub fn into_name(self) -> &'static str { pub fn as_u8(&self) -> u8 {
match self {
Self::Normal => "Normal",
Self::Italic => "Italic",
}
}
pub fn from_name(name: impl AsRef<str>) -> Option<Self> {
match name.as_ref() {
"Normal" => Some(Self::Normal),
"Italic" => Some(Self::Italic),
_ => None,
}
}
pub fn into_num(self) -> u8 {
match self { match self {
Self::Normal => 0, Self::Normal => 0,
Self::Italic => 1, Self::Italic => 1,
} }
} }
pub fn from_num(num: u8) -> Option<Self> { pub fn from_u8(n: u8) -> Option<Self> {
match num { match n {
0 => Some(Self::Normal), 0 => Some(Self::Normal),
1 => Some(Self::Italic), 1 => Some(Self::Italic),
_ => None, _ => None,
@ -259,59 +245,77 @@ impl FontStyle {
} }
} }
impl fmt::Display for FontStyle { impl std::str::FromStr for FontStyle {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { type Err = &'static str;
write!(f, "{}", self.clone().into_name()) fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Normal" => Ok(Self::Normal),
"Italic" => Ok(Self::Italic),
_ => Err("Unknown FontStyle"),
}
}
}
impl std::fmt::Display for FontStyle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
Self::Normal => "Normal",
Self::Italic => "Italic",
}
)
} }
} }
#[rustfmt::skip] #[rustfmt::skip]
const FONT_ENUM_MAP: &[(&str, Option<FontData>)] = &[ const FONT_ENUM_MAP: &[(&str, Option<FontData>)] = &[
("Legacy", Some(("rbxasset://fonts/families/LegacyArial.json", FontWeight::Regular, FontStyle::Normal))), ("Legacy", Some(("rbxasset://fonts/families/LegacyArial.json", FontWeight::Regular, FontStyle::Normal))),
("Arial", Some(("rbxasset://fonts/families/Arial.json", FontWeight::Regular, FontStyle::Normal))), ("Arial", Some(("rbxasset://fonts/families/Arial.json", FontWeight::Regular, FontStyle::Normal))),
("ArialBold", Some(("rbxasset://fonts/families/Arial.json", FontWeight::Bold, FontStyle::Normal))), ("ArialBold", Some(("rbxasset://fonts/families/Arial.json", FontWeight::Bold, FontStyle::Normal))),
("SourceSans", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Regular, FontStyle::Normal))), ("SourceSans", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Regular, FontStyle::Normal))),
("SourceSansBold", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Bold, FontStyle::Normal))), ("SourceSansBold", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Bold, FontStyle::Normal))),
("SourceSansSemibold", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::SemiBold, FontStyle::Normal))), ("SourceSansSemibold", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::SemiBold, FontStyle::Normal))),
("SourceSansLight", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Light, FontStyle::Normal))), ("SourceSansLight", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Light, FontStyle::Normal))),
("SourceSansItalic", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Regular, FontStyle::Italic))), ("SourceSansItalic", Some(("rbxasset://fonts/families/SourceSansPro.json", FontWeight::Regular, FontStyle::Italic))),
("Bodoni", Some(("rbxasset://fonts/families/AccanthisADFStd.json", FontWeight::Regular, FontStyle::Normal))), ("Bodoni", Some(("rbxasset://fonts/families/AccanthisADFStd.json", FontWeight::Regular, FontStyle::Normal))),
("Garamond", Some(("rbxasset://fonts/families/Guru.json", FontWeight::Regular, FontStyle::Normal))), ("Garamond", Some(("rbxasset://fonts/families/Guru.json", FontWeight::Regular, FontStyle::Normal))),
("Cartoon", Some(("rbxasset://fonts/families/ComicNeueAngular.json", FontWeight::Regular, FontStyle::Normal))), ("Cartoon", Some(("rbxasset://fonts/families/ComicNeueAngular.json", FontWeight::Regular, FontStyle::Normal))),
("Code", Some(("rbxasset://fonts/families/Inconsolata.json", FontWeight::Regular, FontStyle::Normal))), ("Code", Some(("rbxasset://fonts/families/Inconsolata.json", FontWeight::Regular, FontStyle::Normal))),
("Highway", Some(("rbxasset://fonts/families/HighwayGothic.json", FontWeight::Regular, FontStyle::Normal))), ("Highway", Some(("rbxasset://fonts/families/HighwayGothic.json", FontWeight::Regular, FontStyle::Normal))),
("SciFi", Some(("rbxasset://fonts/families/Zekton.json", FontWeight::Regular, FontStyle::Normal))), ("SciFi", Some(("rbxasset://fonts/families/Zekton.json", FontWeight::Regular, FontStyle::Normal))),
("Arcade", Some(("rbxasset://fonts/families/PressStart2P.json", FontWeight::Regular, FontStyle::Normal))), ("Arcade", Some(("rbxasset://fonts/families/PressStart2P.json", FontWeight::Regular, FontStyle::Normal))),
("Fantasy", Some(("rbxasset://fonts/families/Balthazar.json", FontWeight::Regular, FontStyle::Normal))), ("Fantasy", Some(("rbxasset://fonts/families/Balthazar.json", FontWeight::Regular, FontStyle::Normal))),
("Antique", Some(("rbxasset://fonts/families/RomanAntique.json", FontWeight::Regular, FontStyle::Normal))), ("Antique", Some(("rbxasset://fonts/families/RomanAntique.json", FontWeight::Regular, FontStyle::Normal))),
("Gotham", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Regular, FontStyle::Normal))), ("Gotham", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Regular, FontStyle::Normal))),
("GothamMedium", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Medium, FontStyle::Normal))), ("GothamMedium", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Medium, FontStyle::Normal))),
("GothamBold", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Bold, FontStyle::Normal))), ("GothamBold", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Bold, FontStyle::Normal))),
("GothamBlack", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Heavy, FontStyle::Normal))), ("GothamBlack", Some(("rbxasset://fonts/families/GothamSSm.json", FontWeight::Heavy, FontStyle::Normal))),
("AmaticSC", Some(("rbxasset://fonts/families/AmaticSC.json", FontWeight::Regular, FontStyle::Normal))), ("AmaticSC", Some(("rbxasset://fonts/families/AmaticSC.json", FontWeight::Regular, FontStyle::Normal))),
("Bangers", Some(("rbxasset://fonts/families/Bangers.json", FontWeight::Regular, FontStyle::Normal))), ("Bangers", Some(("rbxasset://fonts/families/Bangers.json", FontWeight::Regular, FontStyle::Normal))),
("Creepster", Some(("rbxasset://fonts/families/Creepster.json", FontWeight::Regular, FontStyle::Normal))), ("Creepster", Some(("rbxasset://fonts/families/Creepster.json", FontWeight::Regular, FontStyle::Normal))),
("DenkOne", Some(("rbxasset://fonts/families/DenkOne.json", FontWeight::Regular, FontStyle::Normal))), ("DenkOne", Some(("rbxasset://fonts/families/DenkOne.json", FontWeight::Regular, FontStyle::Normal))),
("Fondamento", Some(("rbxasset://fonts/families/Fondamento.json", FontWeight::Regular, FontStyle::Normal))), ("Fondamento", Some(("rbxasset://fonts/families/Fondamento.json", FontWeight::Regular, FontStyle::Normal))),
("FredokaOne", Some(("rbxasset://fonts/families/FredokaOne.json", FontWeight::Regular, FontStyle::Normal))), ("FredokaOne", Some(("rbxasset://fonts/families/FredokaOne.json", FontWeight::Regular, FontStyle::Normal))),
("GrenzeGotisch", Some(("rbxasset://fonts/families/GrenzeGotisch.json", FontWeight::Regular, FontStyle::Normal))), ("GrenzeGotisch", Some(("rbxasset://fonts/families/GrenzeGotisch.json", FontWeight::Regular, FontStyle::Normal))),
("IndieFlower", Some(("rbxasset://fonts/families/IndieFlower.json", FontWeight::Regular, FontStyle::Normal))), ("IndieFlower", Some(("rbxasset://fonts/families/IndieFlower.json", FontWeight::Regular, FontStyle::Normal))),
("JosefinSans", Some(("rbxasset://fonts/families/JosefinSans.json", FontWeight::Regular, FontStyle::Normal))), ("JosefinSans", Some(("rbxasset://fonts/families/JosefinSans.json", FontWeight::Regular, FontStyle::Normal))),
("Jura", Some(("rbxasset://fonts/families/Jura.json", FontWeight::Regular, FontStyle::Normal))), ("Jura", Some(("rbxasset://fonts/families/Jura.json", FontWeight::Regular, FontStyle::Normal))),
("Kalam", Some(("rbxasset://fonts/families/Kalam.json", FontWeight::Regular, FontStyle::Normal))), ("Kalam", Some(("rbxasset://fonts/families/Kalam.json", FontWeight::Regular, FontStyle::Normal))),
("LuckiestGuy", Some(("rbxasset://fonts/families/LuckiestGuy.json", FontWeight::Regular, FontStyle::Normal))), ("LuckiestGuy", Some(("rbxasset://fonts/families/LuckiestGuy.json", FontWeight::Regular, FontStyle::Normal))),
("Merriweather", Some(("rbxasset://fonts/families/Merriweather.json", FontWeight::Regular, FontStyle::Normal))), ("Merriweather", Some(("rbxasset://fonts/families/Merriweather.json", FontWeight::Regular, FontStyle::Normal))),
("Michroma", Some(("rbxasset://fonts/families/Michroma.json", FontWeight::Regular, FontStyle::Normal))), ("Michroma", Some(("rbxasset://fonts/families/Michroma.json", FontWeight::Regular, FontStyle::Normal))),
("Nunito", Some(("rbxasset://fonts/families/Nunito.json", FontWeight::Regular, FontStyle::Normal))), ("Nunito", Some(("rbxasset://fonts/families/Nunito.json", FontWeight::Regular, FontStyle::Normal))),
("Oswald", Some(("rbxasset://fonts/families/Oswald.json", FontWeight::Regular, FontStyle::Normal))), ("Oswald", Some(("rbxasset://fonts/families/Oswald.json", FontWeight::Regular, FontStyle::Normal))),
("PatrickHand", Some(("rbxasset://fonts/families/PatrickHand.json", FontWeight::Regular, FontStyle::Normal))), ("PatrickHand", Some(("rbxasset://fonts/families/PatrickHand.json", FontWeight::Regular, FontStyle::Normal))),
("PermanentMarker", Some(("rbxasset://fonts/families/PermanentMarker.json", FontWeight::Regular, FontStyle::Normal))), ("PermanentMarker", Some(("rbxasset://fonts/families/PermanentMarker.json", FontWeight::Regular, FontStyle::Normal))),
("Roboto", Some(("rbxasset://fonts/families/Roboto.json", FontWeight::Regular, FontStyle::Normal))), ("Roboto", Some(("rbxasset://fonts/families/Roboto.json", FontWeight::Regular, FontStyle::Normal))),
("RobotoCondensed", Some(("rbxasset://fonts/families/RobotoCondensed.json", FontWeight::Regular, FontStyle::Normal))), ("RobotoCondensed", Some(("rbxasset://fonts/families/RobotoCondensed.json", FontWeight::Regular, FontStyle::Normal))),
("RobotoMono", Some(("rbxasset://fonts/families/RobotoMono.json", FontWeight::Regular, FontStyle::Normal))), ("RobotoMono", Some(("rbxasset://fonts/families/RobotoMono.json", FontWeight::Regular, FontStyle::Normal))),
("Sarpanch", Some(("rbxasset://fonts/families/Sarpanch.json", FontWeight::Regular, FontStyle::Normal))), ("Sarpanch", Some(("rbxasset://fonts/families/Sarpanch.json", FontWeight::Regular, FontStyle::Normal))),
("SpecialElite", Some(("rbxasset://fonts/families/SpecialElite.json", FontWeight::Regular, FontStyle::Normal))), ("SpecialElite", Some(("rbxasset://fonts/families/SpecialElite.json", FontWeight::Regular, FontStyle::Normal))),
("TitilliumWeb", Some(("rbxasset://fonts/families/TitilliumWeb.json", FontWeight::Regular, FontStyle::Normal))), ("TitilliumWeb", Some(("rbxasset://fonts/families/TitilliumWeb.json", FontWeight::Regular, FontStyle::Normal))),
("Ubuntu", Some(("rbxasset://fonts/families/Ubuntu.json", FontWeight::Regular, FontStyle::Normal))), ("Ubuntu", Some(("rbxasset://fonts/families/Ubuntu.json", FontWeight::Regular, FontStyle::Normal))),
("Unknown", None), ("Unknown", None),
]; ];