Add option for using a CJK fallback font

This commit is contained in:
Inori 2019-08-31 02:49:41 -04:00 committed by Inori
parent 6f2a9d66cb
commit 8726dd222e
6 changed files with 27 additions and 3 deletions

View file

@ -1,8 +1,13 @@
embedded_assets = [
'icon.png',
'liberation.ttf'
'icon.png'
]
if get_option('cjk_fallback_font') == true
embedded_assets += 'wqymicrohei.ttf'
else
embedded_assets += 'liberation.ttf'
endif
embedded_assets_f = files(embedded_assets)
count = 0

BIN
assets/wqymicrohei.ttf Normal file

Binary file not shown.

View file

@ -4,6 +4,7 @@ option('workdir_current', type: 'boolean', value: false, description: 'Keep curr
option('ruby_lib', type: 'string', value: 'ruby', description: 'Name of the Ruby library')
option('console', type: 'boolean', value: true, description: 'Whether to debug information in the console')
option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font')
option('use_fakeapi', type: 'boolean', value: false, description: 'Attempt to repair Win32API calls that do not work with MKXP')
option('default_framerate', type: 'boolean', value: false, description: 'Disable syncToRefreshrate and fixedFramerate configuration options')
option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option')

View file

@ -1 +1,5 @@
#ifndef CJK_FALLBACK
#include "liberation.ttf.xxd"
#else
#include "wqymicrohei.ttf.xxd"
#endif

View file

@ -33,7 +33,18 @@
#include <SDL_ttf.h>
#ifndef CJK_FALLBACK
#include "liberation.ttf.xxd"
#else
#include "wqymicrohei.ttf.xxd"
#endif
#ifndef CJK_FALLBACK
#define BUNDLED_FONT liberation
#else
#define BUNDLED_FONT wqymicrohei
#endif
#define BUNDLED_FONT_DECL(FONT) \
extern unsigned char ___assets_##FONT##_ttf[]; \

View file

@ -33,6 +33,10 @@ if get_option('default_framerate') == true
add_project_arguments('-DDEFAULT_FRAMERATE', language: 'cpp')
endif
if get_option('cjk_fallback_font') == true
add_project_arguments('-DCJK_FALLBACK', language: 'cpp')
endif
main_headers = files(
'quadarray.h',
'audio.h',
@ -132,7 +136,6 @@ main_source = files(
'alstream.cpp',
'audiostream.cpp',
'rgssad.cpp',
'bundledfont.cpp',
'vorbissource.cpp',
'windowvx.cpp',
'tilemapvx.cpp',