0.522.0.5220281 (+ Font Type Support & Bug Fixes)

This commit is contained in:
Max
2022-04-14 20:52:05 -05:00
parent cff4b1ad5c
commit f8c914dd0b
21 changed files with 3577 additions and 2631 deletions

View File

@ -662,6 +662,23 @@ namespace RobloxFiles.BinaryFormat.Chunks
break;
}
case PropertyType.FontFace:
{
readProperties(i =>
{
string family = reader.ReadString();
if (family.EndsWith(".otf") || family.EndsWith(".ttf"))
return new FontFace(family);
var weight = (FontWeight)reader.ReadUInt16();
var style = (FontStyle)reader.ReadByte();
return new FontFace(family, weight, style);
});
break;
}
default:
{
RobloxFile.LogError($"Unhandled property type: {Type} in {this}!");
@ -1283,6 +1300,27 @@ namespace RobloxFiles.BinaryFormat.Chunks
break;
}
case PropertyType.FontFace:
{
props.ForEach(prop =>
{
var font = prop.CastValue<FontFace>();
string family = font.Family;
writer.WriteString(font.Family);
if (family.EndsWith(".otf") || family.EndsWith(".ttf"))
return;
var weight = (ushort)font.Weight;
writer.Write(weight);
var style = (byte)font.Style;
writer.Write(style);
});
break;
}
default:
{
RobloxFile.LogError($"Unhandled property type: {Type} in {this}!");