This commit is contained in:
Jan Racek
2026-03-27 21:29:24 +01:00
parent 45a552be5a
commit 13ed569eaf
85 changed files with 1953 additions and 2470 deletions

View File

@@ -8,6 +8,7 @@ using UnityEditor;
namespace SplashEdit.RuntimeCode
{
[CreateAssetMenu(fileName = "New PSXFont", menuName = "PSX/Font Asset")]
[Icon("Packages/net.psxsplash.splashedit/Icons/PSXFontAsset.png")]
public class PSXFontAsset : ScriptableObject
{
[Header("Source - Option A: TrueType/OTF Font")]
@@ -154,7 +155,6 @@ namespace SplashEdit.RuntimeCode
if (validCount > 0)
{
workingSize = 0;
Debug.Log("PSXFontAsset: Using font's native size for character info.");
}
}
@@ -273,11 +273,6 @@ namespace SplashEdit.RuntimeCode
// This makes the native advance widths match the bitmap exactly for
// proportional rendering. Characters wider than cell get clipped (rare).
Debug.Log($"PSXFontAsset: Cell {glyphWidth}x{glyphHeight}, {glyphsPerRow}/row, " +
$"{rowCount} rows, texture {texW}x{texH} " +
$"(measured: {measuredMaxW}x{measuredMaxH}, " +
$"ascender={maxAscender}, descender={maxDescender}, vScale={vScale:F2})");
// ── Step 5: Render glyphs into grid ──
// Each glyph is LEFT-ALIGNED at native width for proportional rendering.
// The advance widths from CharacterInfo match native glyph proportions.
@@ -376,8 +371,6 @@ namespace SplashEdit.RuntimeCode
return;
}
Debug.Log($"PSXFontAsset: Rendered {renderedCount}/95 glyphs.");
// Store advance widths from the same CharacterInfo used for rendering.
// This guarantees advances match the bitmap glyphs exactly.
storedAdvanceWidths = new byte[96];
@@ -424,7 +417,6 @@ namespace SplashEdit.RuntimeCode
fontTexture = AssetDatabase.LoadAssetAtPath<Texture2D>(texPath);
EditorUtility.SetDirty(this);
AssetDatabase.SaveAssets();
Debug.Log($"PSXFontAsset: Saved {texW}x{texH} bitmap at {texPath}");
}
#endif