diff --git a/assets/FontAtlasGenerator b/assets/FontAtlasGenerator index b956430..111dfec 160000 --- a/assets/FontAtlasGenerator +++ b/assets/FontAtlasGenerator @@ -1 +1 @@ -Subproject commit b956430964a49b405bb1986a5a90159f7984e86e +Subproject commit 111dfec2a7596b15ba0fdf020254aa3bd9776482 diff --git a/lib/fileTypeUtils/textures/fontAtlasGeneratorTypes.dart b/lib/fileTypeUtils/textures/fontAtlasGeneratorTypes.dart index 59538b5..52facb4 100644 --- a/lib/fileTypeUtils/textures/fontAtlasGeneratorTypes.dart +++ b/lib/fileTypeUtils/textures/fontAtlasGeneratorTypes.dart @@ -62,8 +62,9 @@ class CliFontOptions { final double letYOffset; final double resolutionScale; final int strokeWidth; + final double rgbBlurSize; - CliFontOptions(this.fontPath, this.fontHeight, this.letXPadding, this.letYPadding, this.letXOffset, this.letYOffset, this.resolutionScale, this.strokeWidth); + CliFontOptions(this.fontPath, this.fontHeight, this.letXPadding, this.letYPadding, this.letXOffset, this.letYOffset, this.resolutionScale, this.strokeWidth, this.rgbBlurSize); Map toJson() { return { @@ -75,6 +76,7 @@ class CliFontOptions { "letYOffset": letYOffset, "resolutionScale": resolutionScale, "strokeWidth": strokeWidth, + "rgbBlurSize": rgbBlurSize, }; } } diff --git a/lib/stateManagement/openFiles/types/FtbFileData.dart b/lib/stateManagement/openFiles/types/FtbFileData.dart index 583f44f..9b03bba 100644 --- a/lib/stateManagement/openFiles/types/FtbFileData.dart +++ b/lib/stateManagement/openFiles/types/FtbFileData.dart @@ -304,6 +304,7 @@ class FtbData extends ChangeNotifier { (fontOverride.yOffset.value * heightScale).toDouble(), 1.0, fontOverride.strokeWidth.value.toInt(), + fontOverride.rgbBlurSize.value.toDouble(), ) : null; var newFonts = pendingNewChars.map((c) => c.fontPath).toSet(); if (newFonts.length > 1) @@ -317,6 +318,7 @@ class FtbData extends ChangeNotifier { (fontOverride.yOffset.value * heightScale).toDouble(), 1.0, fontOverride.strokeWidth.value.toInt(), + fontOverride.rgbBlurSize.value.toDouble(), ) : null; // temporary source texture copies List sourceTextures = await Future.wait(textures.map((tex) async { diff --git a/lib/stateManagement/openFiles/types/McdFileData.dart b/lib/stateManagement/openFiles/types/McdFileData.dart index 07f355a..2bf9ece 100644 --- a/lib/stateManagement/openFiles/types/McdFileData.dart +++ b/lib/stateManagement/openFiles/types/McdFileData.dart @@ -305,6 +305,7 @@ class McdFontOverride with HasUuid implements Disposable { final NumberProp xOffset; final NumberProp yOffset; final NumberProp strokeWidth; + final NumberProp rgbBlurSize; final BoolProp isFallbackOnly; McdFontOverride(int firstFontId) : @@ -316,6 +317,7 @@ class McdFontOverride with HasUuid implements Disposable { xOffset = NumberProp(0.0, false, fileId: null), yOffset = NumberProp(0.0, false, fileId: null), strokeWidth = NumberProp(0, true, fileId: null), + rgbBlurSize = NumberProp(0.0, false, fileId: null), isFallbackOnly = BoolProp(false, fileId: null); @override @@ -328,6 +330,7 @@ class McdFontOverride with HasUuid implements Disposable { xOffset.dispose(); heightScale.dispose(); strokeWidth.dispose(); + rgbBlurSize.dispose(); isFallbackOnly.dispose(); } } @@ -1071,6 +1074,7 @@ class McdData extends _McdFilePart { fontOverridesMap[fontId]!.yOffset.value * scaleFact, McdData.fontAtlasResolutionScale.value.toDouble(), fontOverridesMap[fontId]!.strokeWidth.value.toInt(), + fontOverridesMap[fontId]!.rgbBlurSize.value.toDouble(), ); } imgOperations.add(CliImgOperationDrawFromFont( diff --git a/lib/widgets/filesView/types/fonts/FontsManager.dart b/lib/widgets/filesView/types/fonts/FontsManager.dart index ae29246..a8fc562 100644 --- a/lib/widgets/filesView/types/fonts/FontsManager.dart +++ b/lib/widgets/filesView/types/fonts/FontsManager.dart @@ -53,6 +53,7 @@ class __McdFontsManagerState extends ChangeNotifierState { "xOffset", "yOffset", "thickness", + "shadow blur", "", "" ]; @@ -72,8 +73,9 @@ class __McdFontsManagerState extends ChangeNotifierState { 8: FixedColumnWidth(70 + 8), 9: FixedColumnWidth(70 + 8), 10: FixedColumnWidth(70 + 8), - 11: FixedColumnWidth(30 + 8), - 12: FixedColumnWidth(16), + 11: FixedColumnWidth(100 + 8), + 12: FixedColumnWidth(30 + 8), + 13: FixedColumnWidth(16), }, defaultVerticalAlignment: TableCellVerticalAlignment.middle, children: [ @@ -173,6 +175,10 @@ class __McdFontsManagerState extends ChangeNotifierState { McdData.fontOverrides[i].strokeWidth, const PropTFOptions(hintText: "thickness", constraints: BoxConstraints.tightFor(height: 30)), ), + makePropEditor( + McdData.fontOverrides[i].rgbBlurSize, + const PropTFOptions(hintText: "shadow", constraints: BoxConstraints.tightFor(height: 30)), + ), SmallButton( onPressed: () => McdData.fontOverrides.removeAt(i).dispose(), constraints: BoxConstraints.tight(const Size(30, 30)),