diff --git a/index.html b/index.html index c96e6910979..0e8afed6b03 100644 --- a/index.html +++ b/index.html @@ -20,9 +20,9 @@ src: url('./fonts/pokemon-emerald-pro.ttf') format('truetype'); } @font-face { - font-family: 'vonwaon'; - src: url('./fonts/VonwaonBitmap-16px.ttf') format('truetype'); - size-adjust: 66.7%; + font-family: 'unifont'; + src: url('./fonts/unifont-15.1.05.otf') format('opentype'); + size-adjust: 70%; } @font-face { diff --git a/public/fonts/VonwaonBitmap-16px.ttf b/public/fonts/VonwaonBitmap-16px.ttf deleted file mode 100644 index a956053e447..00000000000 Binary files a/public/fonts/VonwaonBitmap-16px.ttf and /dev/null differ diff --git a/public/fonts/unifont-15.1.05.otf b/public/fonts/unifont-15.1.05.otf new file mode 100644 index 00000000000..3d0dcd3c1a0 Binary files /dev/null and b/public/fonts/unifont-15.1.05.otf differ diff --git a/src/main.ts b/src/main.ts index 144f0371ff6..e750335ddd4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -150,7 +150,7 @@ Phaser.GameObjects.Text.prototype.setPositionRelative = setPositionRelative; Phaser.GameObjects.Rectangle.prototype.setPositionRelative = setPositionRelative; document.fonts.load("16px emerald").then(() => document.fonts.load("10px pkmnems")); -document.fonts.load("16px vonwaon"); +document.fonts.load("12px unifont"); let game; diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 0cea1d197e5..5a6353d5f2c 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -89,8 +89,8 @@ export interface Localizable { } const fonts = [ - new FontFace("emerald", "url(./fonts/pokemon-emerald-pro.ttf"), new FontFace("emerald", "url(./fonts/PokePT_Wansung.ttf)"), + new FontFace("emerald", "url(./fonts/pokemon-emerald-pro.ttf"), ]; function initFonts() { diff --git a/src/ui/text.ts b/src/ui/text.ts index 6d5cdd3a6b4..715e4f02430 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -5,6 +5,7 @@ import { EggTier } from "../data/enums/egg-type"; import { UiTheme } from "../enums/ui-theme"; import { ModifierTier } from "../modifier/modifier-tier"; import Phaser from "phaser"; +import i18next from "i18next"; export enum TextStyle { MESSAGE, @@ -83,13 +84,14 @@ export function addTextInputObject(scene: Phaser.Scene, x: number, y: number, wi } function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraStyleOptions?: Phaser.Types.GameObjects.Text.TextStyle): [ number, Phaser.Types.GameObjects.Text.TextStyle | InputText.IConfig, string, number, number ] { + const {resolvedLanguage} = i18next; let shadowXpos = 4; let shadowYpos = 5; const scale = 0.1666666667; const defaultFontSize = 96; let styleOptions: Phaser.Types.GameObjects.Text.TextStyle = { - fontFamily: "emerald, vonwaon", + fontFamily: "emerald, unifont", fontSize: 96, color: getTextColor(style, false, uiTheme), padding: { @@ -142,6 +144,11 @@ function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraStyleOptio break; } + if (["zh"].includes(resolvedLanguage.substring(0,2))) { + shadowXpos = 0; + shadowYpos = 0; + } + const shadowColor = getTextColor(style, true, uiTheme); if (extraStyleOptions) {