mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Fix dealing with MergeMode for plugin-requested fonts
This commit is contained in:
parent
42f199a040
commit
5fa750750b
1 changed files with 20 additions and 2 deletions
|
|
@ -845,8 +845,26 @@ namespace Dalamud.Interface.Internal
|
||||||
|
|
||||||
var name = Encoding.UTF8.GetString((byte*)config.Name.Data, config.Name.Count).TrimEnd('\0');
|
var name = Encoding.UTF8.GetString((byte*)config.Name.Data, config.Name.Count).TrimEnd('\0');
|
||||||
|
|
||||||
// While the font will be loaded in the scaled size after FontScale is applied, the font will be treated as having the requested size when used from plugins.
|
// ImFont information is reflected only if corresponding ImFontConfig has MergeMode not set.
|
||||||
this.loadedFontInfo[config.DstFont.NativePtr] = new($"PluginRequest({name})", config.SizePixels);
|
if (config.MergeMode)
|
||||||
|
{
|
||||||
|
if (!this.loadedFontInfo.ContainsKey(config.DstFont.NativePtr))
|
||||||
|
{
|
||||||
|
Log.Warning("MergeMode specified for {0} but not found in loadedFontInfo. Skipping.", name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (this.loadedFontInfo.ContainsKey(config.DstFont.NativePtr))
|
||||||
|
{
|
||||||
|
Log.Warning("MergeMode not specified for {0} but found in loadedFontInfo. Skipping.", name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// While the font will be loaded in the scaled size after FontScale is applied, the font will be treated as having the requested size when used from plugins.
|
||||||
|
this.loadedFontInfo[config.DstFont.NativePtr] = new($"PlReq({name})", config.SizePixels);
|
||||||
|
}
|
||||||
|
|
||||||
if (disableBigFonts)
|
if (disableBigFonts)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue