larsiusprime / firetongue

A translation/localization framework written in Haxe
MIT License
143 stars 32 forks source link

how to display Chinese via a custom font in Firetongue? #32

Open nykevinwong opened 6 years ago

nykevinwong commented 6 years ago

hi FireTongue Developer, I tried to integrate FireTongue for multi-language feature of my haxeflixel game, but the chinese can't be displayed in FireTongue. in FireTongue example, it has no chinese example integrated.

I am trying to use the Chinese font wp310-08.tff obtained from below wangfonts-1.3.0.zip.

https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wangfonts/wangfonts-1.3.0.zip

all free GNU Chinese fonts. https://code.google.com/archive/p/wangfonts/downloads

below is Traditional Chinese text I used to display:

中文

larsiusprime commented 6 years ago

I'll look into this next time I have a chance, but likely the issue is on your framework's end (flixel) rather than firetongue. Firetongue is just a way to manage strings.

Based on my experience with Haxeflixel, you need to compile with the "-Dnext" flag enabled. Flixel defaults to OpenFL legacy version by default, which does not have robust UTF8 text rendering support. However, if you compile with "-Dnext" enabled, you tell Flixel to use the latest version of OpenFL, which does work (I use HaxeFlixel with firetongue myself for chinese text).

When I next have time I will update the sample to include some Chinese text, and include explicit instructions.

On Sat, Mar 10, 2018 at 2:24 AM, nykevinwong notifications@github.com wrote:

hi FireTongue Developer, I tried to integrate FireTongue for multi-language feature of my haxeflixel game, but the chinese can't be displayed in FireTongue. in FireTongue example, it has no chinese example integrated.

I am trying to use the Chinese font wp310-08.tff obtained from below wangfonts-1.3.0.zip.

https://storage.googleapis.com/google-code-archive- downloads/v2/code.google.com/wangfonts/wangfonts-1.3.0.zip

all free GNU Chinese fonts. https://code.google.com/archive/p/wangfonts/downloads

below is Traditional Chinese text I used to display:

中文

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/larsiusprime/firetongue/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtG-NjrO-z1tZuPe4vjRUXlpU488Xanks5tc42-gaJpZM4SlMV_ .

-- www.fortressofdoors.com -- Games, Art, Design

nykevinwong commented 6 years ago

I am able to display Chinese font now. It's working on html5/android/windows build. I switched to use the corresponding embedded/preloaded font when using different language.

The working example can be seen from my android game. there's an option to switch the language from the start menu.

https://play.google.com/store/apps/details?id=com.gamecopter.supermario.mario.gaiaisland&hl=en_US