mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-29 19:44:49 +02:00
Add option for using a CJK fallback font
This commit is contained in:
parent
6f2a9d66cb
commit
8726dd222e
6 changed files with 27 additions and 3 deletions
|
@ -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
BIN
assets/wqymicrohei.ttf
Normal file
Binary file not shown.
|
@ -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')
|
|
@ -1 +1,5 @@
|
|||
#ifndef CJK_FALLBACK
|
||||
#include "liberation.ttf.xxd"
|
||||
#else
|
||||
#include "wqymicrohei.ttf.xxd"
|
||||
#endif
|
||||
|
|
11
src/font.cpp
11
src/font.cpp
|
@ -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[]; \
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue