Somewhat fixed ui
This commit is contained in:
@@ -634,7 +634,7 @@ namespace SplashEdit.RuntimeCode
|
||||
|
||||
// ──────────────────────────────────────────────────────
|
||||
// UI canvas + font data (version 13)
|
||||
// Font descriptors: 16 bytes each (before canvas data)
|
||||
// Font descriptors: 112 bytes each (before canvas data)
|
||||
// Font pixel data: raw 4bpp (after font descriptors)
|
||||
// Canvas descriptor table: 12 bytes per canvas
|
||||
// Element records: 48 bytes each
|
||||
@@ -645,7 +645,7 @@ namespace SplashEdit.RuntimeCode
|
||||
AlignToFourBytes(writer);
|
||||
long uiTableStart = writer.BaseStream.Position;
|
||||
|
||||
// ── Font descriptors (16 bytes each) ──
|
||||
// ── Font descriptors (112 bytes each) ──
|
||||
// Layout: glyphW(1) glyphH(1) vramX(2) vramY(2) textureH(2)
|
||||
// dataOffset(4) dataSize(4)
|
||||
List<long> fontDataOffsetPositions = new List<long>();
|
||||
@@ -661,6 +661,11 @@ namespace SplashEdit.RuntimeCode
|
||||
fontDataOffsetPositions.Add(writer.BaseStream.Position);
|
||||
writer.Write((uint)0); // [8-11] dataOffset placeholder
|
||||
writer.Write((uint)(font.PixelData?.Length ?? 0)); // [12-15] dataSize
|
||||
// [16-111] per-character advance widths for proportional rendering
|
||||
if (font.AdvanceWidths != null && font.AdvanceWidths.Length >= 96)
|
||||
writer.Write(font.AdvanceWidths, 0, 96);
|
||||
else
|
||||
writer.Write(new byte[96]); // zero-fill if missing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user