Temporary solution to read woff2

This commit is contained in:
ema
2024-12-30 04:21:24 +08:00
parent ffecab95be
commit 4eb4251db5
91 changed files with 34874 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
using System.IO;
namespace Typography.OpenFont;
internal static class BinaryReaderExtensions
{
public static ushort ReadUInt16BE(this BinaryReader reader)
{
byte[] bytes = reader.ReadBytes(2);
return (ushort)((bytes[0] << 8) | bytes[1]);
}
public static uint ReadUInt32BE(this BinaryReader reader)
{
byte[] bytes = reader.ReadBytes(4);
return (uint)((bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]);
}
}