Add CJK Font fallback. #1058

Merged
merged 8 commits into from Oct 16, 2016

Conversation

Projects
None yet
4 participants
@DBLobster
Contributor

DBLobster commented Oct 13, 2016

Hi, I add a WenQuanYi 9pt font to resolve missing CJK glyphs.

WenQuanYi font is GPL v2 (with font embedding exception).

I only update automake script. Can someone update other platform build script?

Thanks.
5 0
master
wqy

Edit by carstene1ns:
Fixes #260.

DBLobster added some commits Oct 12, 2016

Unicode 5.2 Font from WenQuanYi, 9pt.
wenquanyi_9pt.bdf: GPL v2 (with font embedding exception)
bdfmerge.pl: Public Domain

See:
http://wenq.org/
https://sourceforge.net/projects/wqy/files/wqy-bitmapfont/1.0.0-RC1/
from wqy-bitmapsong-bdf-1.0.0-RC1.tar.gz
Fix: bdfmerge array. gen CJK Basic font.
./bdfmerge.pl 0x4E00--0x9FCB wenquanyi_9pt.bdf > wenquanyi_cjk_basic_9pt.bdf

0x4E00--0x9FFF is section of Unicdoe CJK Basic.
WenQuanYi(wqy) is Unicode 5.2 fonts, so 0x4E00--0x9FCB.
gen WenQuanYi CJK Basic C++ code.
./gen_wqy_font_cpp.py
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 13, 2016

Member

I'm not a lawyer so I can't say if GPLv2 with Font embedding exception is incompatible to GPLv3+.

I was worried about another thing: We plan to relicense the Player with a GPL Linking Exception which would be incompatible to GPLv2+FontEmbedding but you putted the fonts in a different file so for such a GPL-incompatible build we could just ifdef out that part 👍

Member

Ghabry commented Oct 13, 2016

I'm not a lawyer so I can't say if GPLv2 with Font embedding exception is incompatible to GPLv3+.

I was worried about another thing: We plan to relicense the Player with a GPL Linking Exception which would be incompatible to GPLv2+FontEmbedding but you putted the fonts in a different file so for such a GPL-incompatible build we could just ifdef out that part 👍

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 13, 2016

Member

Updating the other platform files is simple. Most platforms just compile all cpp files they can find, except CMake and Windows (Visual Studio).

Where to add the files:
CMakeLists.txt, just add file to the filelist.

VIsual Studio:
builds/vs2015/PlayerLib.vcxproj
Add a "ClCompile" block

builds/vs2015/PlayerLib.vcxproj.filters
Add new "ClCompile" with Filter "Source Files\Shinonome"

Member

Ghabry commented Oct 13, 2016

Updating the other platform files is simple. Most platforms just compile all cpp files they can find, except CMake and Windows (Visual Studio).

Where to add the files:
CMakeLists.txt, just add file to the filelist.

VIsual Studio:
builds/vs2015/PlayerLib.vcxproj
Add a "ClCompile" block

builds/vs2015/PlayerLib.vcxproj.filters
Add new "ClCompile" with Filter "Source Files\Shinonome"

@DBLobster

This comment has been minimized.

Show comment
Hide comment
@DBLobster

DBLobster Oct 14, 2016

Contributor

Thanks.

I updated CMake and Visual Studio files.

Contributor

DBLobster commented Oct 14, 2016

Thanks.

I updated CMake and Visual Studio files.

@Ghabry

Ghabry approved these changes Oct 14, 2016

Looks good to me. What do the other devs think? Unfortunately it makes the executable 500kbyte hugher but on the other hand it solves all our CJK font problems.

The fallback code is also nice because this allows us to use a different font file for chinese games, otherwise they get japanese kanjis.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 14, 2016

Member

Tested via the chinese wadanohara game. Works for me on Windows and Linux (though not in Wine but that's not our problem) and all glyphs are displayed (can't say if the correct ones, lack of Chinese knowledge, so I trust the dev here ^^')

Member

Ghabry commented Oct 14, 2016

Tested via the chinese wadanohara game. Works for me on Windows and Linux (though not in Wine but that's not our problem) and all glyphs are displayed (can't say if the correct ones, lack of Chinese knowledge, so I trust the dev here ^^')

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 14, 2016

Member

@carstene1ns any opinion on this?

Member

Ghabry commented Oct 14, 2016

@carstene1ns any opinion on this?

@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Oct 16, 2016

Member

IMO we are covered by the FE, Player renders the font unmodified and makes a (dynamically generated) document.
About the size: well, will only make problems on our constrained platform ports.

Off topic: We already have a lot included in the executable, but leaving things out and making it modular is a big task and having different builds around (for example one for Chinese, one for Western and one for Japanese with different fonts) will make everything more complicated for now.

Member

carstene1ns commented Oct 16, 2016

IMO we are covered by the FE, Player renders the font unmodified and makes a (dynamically generated) document.
About the size: well, will only make problems on our constrained platform ports.

Off topic: We already have a lot included in the executable, but leaving things out and making it modular is a big task and having different builds around (for example one for Chinese, one for Western and one for Japanese with different fonts) will make everything more complicated for now.

@Ghabry Ghabry merged commit 692df1e into EasyRPG:master Oct 16, 2016

6 checks passed

Android (armeabi-v7a) Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 16, 2016

Member

With different font files I meant the embedded ones. When a chinese game is used we could use WenQuanYi instead of shinonome for kanji lookup because WenQ has chinese kanji font.
I don't want to make custom builds, just a runtime switch :D

Member

Ghabry commented Oct 16, 2016

With different font files I meant the embedded ones. When a chinese game is used we could use WenQuanYi instead of shinonome for kanji lookup because WenQ has chinese kanji font.
I don't want to make custom builds, just a runtime switch :D

@Ghabry Ghabry added this to the 0.5.1 milestone Feb 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment