diff --git a/data/CommonEvents.json b/data/CommonEvents.json index 15bbedb..39840c4 100644 --- a/data/CommonEvents.json +++ b/data/CommonEvents.json @@ -425,7 +425,7 @@ "set", "テキストピクチャの設定", { - "text": "Attack \\V[32] Mag.Atk \\V[34] Agility \\V[36]" + "text": "Attack \\V[32]\nMag.Atk \\V[34]\nAgility \\V[36]" } ] }, @@ -460,7 +460,7 @@ "set", "テキストピクチャの設定", { - "text": "Defense \\V[33] Mag.Def \\V[35] Luck   \\V[37]" + "text": "Defense \\V[33]\nMag.Def \\V[35]\nLuck \\V[37]" } ] }, diff --git a/js/plugins/LL_GalgeChoiceWindow.js b/js/plugins/LL_GalgeChoiceWindow.js index 9439847..d19b9e6 100644 --- a/js/plugins/LL_GalgeChoiceWindow.js +++ b/js/plugins/LL_GalgeChoiceWindow.js @@ -668,7 +668,7 @@ const align = this.itemTextAlign(); this.resetTextColor(); this.changePaintOpacity(this.isCommandEnabled(index)); - this.drawText(this.convertEscapeCharacters(this.commandName(index)), rect.x, rect.y, rect.width, align); + this.drawText(this.breakLigatures(this.convertEscapeCharacters(this.commandName(index))), rect.x, rect.y, rect.width, align); }; Window_GalgeChoiceList.prototype.isCancelEnabled = function() { diff --git a/js/plugins/TextPicture.js b/js/plugins/TextPicture.js index 3521c4b..e9a3242 100644 --- a/js/plugins/TextPicture.js +++ b/js/plugins/TextPicture.js @@ -56,8 +56,13 @@ const pluginName = "TextPicture"; let textPictureText = ""; + function breakLigatures(text) { + // Insert zero-width non-joiner (U+200C) to prevent missing ligature glyphs (fi, fl, ff, etc.) + return text.replace(/f([filt])/g, "f\u200C$1"); + } + PluginManager.registerCommand(pluginName, "set", args => { - textPictureText = String(args.text); + textPictureText = breakLigatures(String(args.text)); }); const _Game_Picture_show = Game_Picture.prototype.show; @@ -96,11 +101,17 @@ function createTextPictureBitmap(text) { const tempWindow = new Window_Base(new Rectangle()); + tempWindow.resetFontSettings = function() { + this.contents.fontFace = $gameSystem.mainFontFace(); + this.contents.fontSize = 20; + this.resetTextColor(); + }; const size = tempWindow.textSizeEx(text); + const pad = 4; // extra pixels on each side to prevent outline clipping tempWindow.padding = 0; - tempWindow.move(0, 0, size.width, size.height); + tempWindow.move(0, 0, size.width + pad * 2, size.height + pad * 2); tempWindow.createContents(); - tempWindow.drawTextEx(text, 0, 0, 0); + tempWindow.drawTextEx(text, pad, pad, 0); const bitmap = tempWindow.contents; tempWindow.contents = null; tempWindow.destroy();