From 3d576a0654bb947cc6dbaa43fc4a7ff6610913cf Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Sun, 10 Dec 2023 15:40:58 +0900 Subject: [PATCH] Fix inconsistencies --- .../Internals/FontAtlasFactory.BuildToolkit.cs | 6 +----- .../ManagedFontAtlas/Internals/GamePrebakedFontHandle.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.BuildToolkit.cs b/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.BuildToolkit.cs index 4fa4c6a9e..a3abc6681 100644 --- a/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.BuildToolkit.cs +++ b/Dalamud/Interface/ManagedFontAtlas/Internals/FontAtlasFactory.BuildToolkit.cs @@ -398,8 +398,6 @@ internal sealed partial class FontAtlasFactory config.GlyphMinAdvanceX = config.GlyphMinAdvanceX > 0 ? float.MaxValue : -float.MaxValue; config.GlyphOffset *= this.Scale; - - config.RasterizerGamma *= 1.4f; } } @@ -426,9 +424,7 @@ internal sealed partial class FontAtlasFactory var scale = this.Scale; foreach (ref var font in this.Fonts.DataSpan) { - if (this.GlobalScaleExclusions.Contains(font)) - font.AdjustGlyphMetrics(1f, 1f); // we still need to round advanceX and kerning - else + if (!this.GlobalScaleExclusions.Contains(font)) font.AdjustGlyphMetrics(1 / scale, scale); foreach (var c in FallbackCodepoints) diff --git a/Dalamud/Interface/ManagedFontAtlas/Internals/GamePrebakedFontHandle.cs b/Dalamud/Interface/ManagedFontAtlas/Internals/GamePrebakedFontHandle.cs index 7e9ef9019..040f9a743 100644 --- a/Dalamud/Interface/ManagedFontAtlas/Internals/GamePrebakedFontHandle.cs +++ b/Dalamud/Interface/ManagedFontAtlas/Internals/GamePrebakedFontHandle.cs @@ -621,8 +621,12 @@ internal class GamePrebakedFontHandle : IFontHandle.IInternal if (addExtraLanguageGlyphs) { - toolkitPreBuild.AddExtraGlyphsForDalamudLanguage( - new(toolkitPreBuild.FindConfigPtr(font)) { MergeFont = font }); + var cfg = toolkitPreBuild.FindConfigPtr(font); + toolkitPreBuild.AddExtraGlyphsForDalamudLanguage(new() + { + MergeFont = cfg.DstFont, + SizePx = cfg.SizePixels, + }); } var fas = GameFontStyle.GetRecommendedFamilyAndSize(style.Family, style.SizePt * toolkitPreBuild.Scale);