From 2ddae74456d9024a9c6a73e09e8b60fd4779bdc6 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 30 Dec 2022 04:20:01 -0600 Subject: [PATCH] Update Font.cs --- Tokens/Font.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Tokens/Font.cs b/Tokens/Font.cs index 977efb4..59d53da 100644 --- a/Tokens/Font.cs +++ b/Tokens/Font.cs @@ -44,17 +44,20 @@ namespace RobloxFiles.Tokens string family = font.Family; string familyType = "null"; + string cached = font.CachedFaceId; string cachedType = "null"; - string cachedId = font.CachedFaceId; if (family.Length > 0) familyType = "url"; - if (cachedId.Length > 0) + if (cached.Length > 0) cachedType = "url"; var familyNode = doc.CreateElement("Family"); - familyNode.InnerText = $"<{familyType}>{family}"; + var familyTypeNode = doc.CreateElement(familyType); + + familyTypeNode.InnerText = family; + familyNode.AppendChild(familyTypeNode); node.AppendChild(familyNode); var weightNode = doc.CreateElement("Weight"); @@ -65,9 +68,12 @@ namespace RobloxFiles.Tokens styleNode.InnerText = $"{font.Style}"; node.AppendChild(styleNode); - var cacheNode = doc.CreateElement("CachedFaceId"); - cacheNode.InnerText = $"<{cachedType}>{cachedId}"; - node.AppendChild(cacheNode); + var cachedNode = doc.CreateElement("CachedFaceId"); + var cachedTypeNode = doc.CreateElement(cachedType); + + cachedTypeNode.InnerText = cached; + cachedNode.AppendChild(cachedTypeNode); + node.AppendChild(cachedNode); } public FontFace ReadAttribute(RbxAttribute attribute)