Skip to content

Commit

Permalink
[Enhancement] Support for special characters(♪.★,♥,♣) in game font (i…
Browse files Browse the repository at this point in the history
…ssue#3180) (pagefaultgames#3535)

* added  specialCharacters: "♪.★,♥,♣"

* did refactoring...maybe

* added note
  • Loading branch information
sodaMelon authored Aug 22, 2024
1 parent 34bf932 commit 6ea0f3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file modified public/fonts/PokePT_Wansung.woff2
Binary file not shown.
10 changes: 10 additions & 0 deletions src/plugins/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const unicodeRanges = {
kana: "U+3040-30FF",
CJKCommon: "U+2E80-2EFF,U+3000-303F,U+31C0-31EF,U+3200-32FF,U+3400-4DBF,U+F900-FAFF,U+FE30-FE4F",
CJKIdeograph: "U+4E00-9FFF",
specialCharacters: "U+266A,U+2605,U+2665,U+2663" //♪.★,♥,♣
};
const rangesByLanguage = {
korean: [unicodeRanges.CJKCommon, unicodeRanges.hangul].join(","),
Expand All @@ -34,6 +35,15 @@ const rangesByLanguage = {
};

const fonts: Array<LoadingFontFaceProperty> = [
// unicode (special character from PokePT)
{
face: new FontFace("emerald", "url(./fonts/PokePT_Wansung.woff2)", { unicodeRange: unicodeRanges.specialCharacters }),
},
{
face: new FontFace("pkmnems", "url(./fonts/PokePT_Wansung.woff2)", { unicodeRange: unicodeRanges.specialCharacters }),
extraOptions: { sizeAdjust: "133%" },
},
// unicode (korean)
{
face: new FontFace("emerald", "url(./fonts/PokePT_Wansung.woff2)", { unicodeRange: rangesByLanguage.korean }),
},
Expand Down

0 comments on commit 6ea0f3f

Please sign in to comment.