Bundle the Hellion icon and Exo 2 font
Replace the inherited Chat 2 icon with the 1024×1024 Hellion logo from the Hellion Online Media brand assets so the plugin shows its real identity in Dalamud's plugin list. Bundle Exo 2 Variable (SIL Open Font License 1.1) as an embedded resource together with the OFL license text — keeps the license travelling with the font inside the assembly as the OFL requires. A new Configuration.UseHellionFont (default true) plus a checkbox in the Privacy tab Appearance section route FontManager's regular font handle through tk.AddFontFromMemory using the embedded TTF bytes when the toggle is on; flipping it off falls back to the existing AddFontWithFallback path so users who picked their own system font under Settings → Fonts keep that choice. Settings.cs now treats UseHellionFont as a font-changing setting so toggling it triggers FontManager.BuildFonts on save without needing a plugin reload.
This commit is contained in:
@@ -43,6 +43,20 @@
|
|||||||
+ HellionStrings.<lang>.resx) is picked up automatically by the SDK
|
+ HellionStrings.<lang>.resx) is picked up automatically by the SDK
|
||||||
default include. Designer.cs is hand-maintained, no auto-gen needed. -->
|
default include. Designer.cs is hand-maintained, no auto-gen needed. -->
|
||||||
|
|
||||||
|
<!-- Bundled Hellion font (Exo 2, OFL-1.1). Embedded as a manifest
|
||||||
|
resource with a fixed LogicalName so FontManager can pull the
|
||||||
|
bytes back at runtime via AddFontFromMemory. The OFL license
|
||||||
|
text travels with it inside the assembly to satisfy the
|
||||||
|
"license must be distributed with the font" clause. -->
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Resources\HellionFont.ttf">
|
||||||
|
<LogicalName>HellionFont.ttf</LogicalName>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\HellionFont-OFL.txt">
|
||||||
|
<LogicalName>HellionFont-OFL.txt</LogicalName>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="images\" />
|
<Folder Include="images\" />
|
||||||
|
|||||||
@@ -75,6 +75,12 @@ public class Configuration : IPluginConfiguration
|
|||||||
// panes more glass-like so the game shines through. Default ~92%.
|
// panes more glass-like so the game shines through. Default ~92%.
|
||||||
public float HellionThemeWindowOpacity = 0.92f;
|
public float HellionThemeWindowOpacity = 0.92f;
|
||||||
|
|
||||||
|
// Use the bundled Exo 2 font (OFL-1.1) for the regular plugin font
|
||||||
|
// instead of whatever GlobalFontV2.FontId points at. Default ON so a
|
||||||
|
// fresh install gets the Hellion typography out-of-the-box; flip OFF
|
||||||
|
// to fall back to the user's chosen system or Dalamud font.
|
||||||
|
public bool UseHellionFont = true;
|
||||||
|
|
||||||
public int GetRetentionDays(ChatType type)
|
public int GetRetentionDays(ChatType type)
|
||||||
{
|
{
|
||||||
if (RetentionPerChannelDays.TryGetValue(type, out var userOverride))
|
if (RetentionPerChannelDays.TryGetValue(type, out var userOverride))
|
||||||
@@ -255,6 +261,7 @@ public class Configuration : IPluginConfiguration
|
|||||||
FirstRunCompleted = other.FirstRunCompleted;
|
FirstRunCompleted = other.FirstRunCompleted;
|
||||||
HellionThemeEnabled = other.HellionThemeEnabled;
|
HellionThemeEnabled = other.HellionThemeEnabled;
|
||||||
HellionThemeWindowOpacity = other.HellionThemeWindowOpacity;
|
HellionThemeWindowOpacity = other.HellionThemeWindowOpacity;
|
||||||
|
UseHellionFont = other.UseHellionFont;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+24
-1
@@ -49,6 +49,27 @@ public class FontManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Backing bytes for the bundled Hellion font (Exo 2, OFL-1.1). Lazily
|
||||||
|
/// extracted from the assembly's manifest resources on first use; the
|
||||||
|
/// load happens inside the font atlas build callback so we keep the
|
||||||
|
/// allocation off the plugin constructor's hot path.
|
||||||
|
/// </summary>
|
||||||
|
private static byte[]? HellionFontBytes;
|
||||||
|
|
||||||
|
private static byte[] GetHellionFontBytes()
|
||||||
|
{
|
||||||
|
if (HellionFontBytes is not null)
|
||||||
|
return HellionFontBytes;
|
||||||
|
|
||||||
|
using var stream = typeof(FontManager).Assembly.GetManifestResourceStream("HellionFont.ttf")
|
||||||
|
?? throw new FileNotFoundException("Hellion font resource not embedded in the assembly");
|
||||||
|
using var ms = new MemoryStream();
|
||||||
|
stream.CopyTo(ms);
|
||||||
|
HellionFontBytes = ms.ToArray();
|
||||||
|
return HellionFontBytes;
|
||||||
|
}
|
||||||
|
|
||||||
private unsafe void SetUpRanges()
|
private unsafe void SetUpRanges()
|
||||||
{
|
{
|
||||||
ushort[] BuildRange(IReadOnlyList<ushort>? chars, params nint[] ranges)
|
ushort[] BuildRange(IReadOnlyList<ushort>? chars, params nint[] ranges)
|
||||||
@@ -121,7 +142,9 @@ public class FontManager
|
|||||||
tk =>
|
tk =>
|
||||||
{
|
{
|
||||||
var config = new SafeFontConfig {SizePt = Plugin.Config.GlobalFontV2.SizePt, GlyphRanges = Ranges};
|
var config = new SafeFontConfig {SizePt = Plugin.Config.GlobalFontV2.SizePt, GlyphRanges = Ranges};
|
||||||
config.MergeFont = AddFontWithFallback(tk, Plugin.Config.GlobalFontV2.FontId, config, "global");
|
config.MergeFont = Plugin.Config.UseHellionFont
|
||||||
|
? tk.AddFontFromMemory(GetHellionFontBytes(), config, "Hellion-Exo2")
|
||||||
|
: AddFontWithFallback(tk, Plugin.Config.GlobalFontV2.FontId, config, "global");
|
||||||
|
|
||||||
config.SizePt = Plugin.Config.JapaneseFontV2.SizePt;
|
config.SizePt = Plugin.Config.JapaneseFontV2.SizePt;
|
||||||
config.GlyphRanges = JpRange;
|
config.GlyphRanges = JpRange;
|
||||||
|
|||||||
Executable
+93
@@ -0,0 +1,93 @@
|
|||||||
|
Copyright 2013 The Exo 2 Project Authors (https://github.com/googlefonts/Exo-2.0)
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
https://openfontlicense.org
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
Executable
BIN
Binary file not shown.
+2
@@ -136,4 +136,6 @@ internal class HellionStrings
|
|||||||
internal static string Theme_Enabled_Description => Get(nameof(Theme_Enabled_Description));
|
internal static string Theme_Enabled_Description => Get(nameof(Theme_Enabled_Description));
|
||||||
internal static string Theme_WindowOpacity_Label => Get(nameof(Theme_WindowOpacity_Label));
|
internal static string Theme_WindowOpacity_Label => Get(nameof(Theme_WindowOpacity_Label));
|
||||||
internal static string Theme_WindowOpacity_Help => Get(nameof(Theme_WindowOpacity_Help));
|
internal static string Theme_WindowOpacity_Help => Get(nameof(Theme_WindowOpacity_Help));
|
||||||
|
internal static string Theme_UseHellionFont_Name => Get(nameof(Theme_UseHellionFont_Name));
|
||||||
|
internal static string Theme_UseHellionFont_Description => Get(nameof(Theme_UseHellionFont_Description));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,4 +279,10 @@
|
|||||||
<data name="Theme_WindowOpacity_Help" xml:space="preserve">
|
<data name="Theme_WindowOpacity_Help" xml:space="preserve">
|
||||||
<value>Wie deckend die Plugin-Fenster sind. Niedrigere Werte lassen das Spiel durchscheinen, Form-Felder und Dialoge bleiben oben drauf deckend und gut lesbar.</value>
|
<value>Wie deckend die Plugin-Fenster sind. Niedrigere Werte lassen das Spiel durchscheinen, Form-Felder und Dialoge bleiben oben drauf deckend und gut lesbar.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Theme_UseHellionFont_Name" xml:space="preserve">
|
||||||
|
<value>Mitgelieferte Hellion-Schrift (Exo 2) verwenden</value>
|
||||||
|
</data>
|
||||||
|
<data name="Theme_UseHellionFont_Description" xml:space="preserve">
|
||||||
|
<value>Rendert Chat und UI in Exo 2 (SIL Open Font License 1.1), die mit dem Plugin ausgeliefert wird. Deaktivieren, um auf die unter Einstellungen → Schrift gewählte Schriftart zurückzufallen.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -279,4 +279,10 @@
|
|||||||
<data name="Theme_WindowOpacity_Help" xml:space="preserve">
|
<data name="Theme_WindowOpacity_Help" xml:space="preserve">
|
||||||
<value>How opaque the plugin panes are. Lower values let the game shine through; form fields and dialogs stay opaque on top so they remain readable.</value>
|
<value>How opaque the plugin panes are. Lower values let the game shine through; form fields and dialogs stay opaque on top so they remain readable.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Theme_UseHellionFont_Name" xml:space="preserve">
|
||||||
|
<value>Use the bundled Hellion font (Exo 2)</value>
|
||||||
|
</data>
|
||||||
|
<data name="Theme_UseHellionFont_Description" xml:space="preserve">
|
||||||
|
<value>Renders chat and UI in Exo 2 (SIL Open Font License 1.1) which ships with the plugin. Disable to fall back to whatever font you picked under Settings → Fonts.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -156,7 +156,8 @@ public sealed class SettingsWindow : Window
|
|||||||
var fontChanged = Mutable.GlobalFontV2 != Plugin.Config.GlobalFontV2
|
var fontChanged = Mutable.GlobalFontV2 != Plugin.Config.GlobalFontV2
|
||||||
|| Mutable.JapaneseFontV2 != Plugin.Config.JapaneseFontV2
|
|| Mutable.JapaneseFontV2 != Plugin.Config.JapaneseFontV2
|
||||||
|| Mutable.ItalicFontV2 != Plugin.Config.ItalicFontV2
|
|| Mutable.ItalicFontV2 != Plugin.Config.ItalicFontV2
|
||||||
|| Mutable.ExtraGlyphRanges != Plugin.Config.ExtraGlyphRanges;
|
|| Mutable.ExtraGlyphRanges != Plugin.Config.ExtraGlyphRanges
|
||||||
|
|| Mutable.UseHellionFont != Plugin.Config.UseHellionFont;
|
||||||
var fontSizeChanged = Math.Abs(Mutable.SymbolsFontSizeV2 - Plugin.Config.SymbolsFontSizeV2) > 0.001
|
var fontSizeChanged = Math.Abs(Mutable.SymbolsFontSizeV2 - Plugin.Config.SymbolsFontSizeV2) > 0.001
|
||||||
|| Math.Abs(Mutable.FontSizeV2 - Plugin.Config.FontSizeV2) > 0.001;
|
|| Math.Abs(Mutable.FontSizeV2 - Plugin.Config.FontSizeV2) > 0.001;
|
||||||
var italicStateChanged = Mutable.ItalicEnabled != Plugin.Config.ItalicEnabled;
|
var italicStateChanged = Mutable.ItalicEnabled != Plugin.Config.ItalicEnabled;
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ internal sealed class Privacy : ISettingsTab
|
|||||||
Mutable.HellionThemeWindowOpacity = Math.Clamp(opacity, 0.5f, 1.0f);
|
Mutable.HellionThemeWindowOpacity = Math.Clamp(opacity, 0.5f, 1.0f);
|
||||||
ImGuiUtil.HelpText(HellionStrings.Theme_WindowOpacity_Help);
|
ImGuiUtil.HelpText(HellionStrings.Theme_WindowOpacity_Help);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
ImGuiUtil.OptionCheckbox(
|
||||||
|
ref Mutable.UseHellionFont,
|
||||||
|
HellionStrings.Theme_UseHellionFont_Name,
|
||||||
|
HellionStrings.Theme_UseHellionFont_Description);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 481 KiB |
Reference in New Issue
Block a user