diff --git a/dev-build.sh b/dev-build.sh index de546c8..cf3e3b4 100755 --- a/dev-build.sh +++ b/dev-build.sh @@ -2,14 +2,17 @@ set -e +OPT= +#OPT="$OPT WITH_FULL_UNICODE_FONT=1" + if [ "$2" == "clean" ]; then - scons PREFIX=$1 DEBUG=1 -c - scons PREFIX=$1-release BUILD_DIR=build-release -c + scons PREFIX=$1 DEBUG=1 $OPT -c + scons PREFIX=$1-release $OPT BUILD_DIR=build-release -c cd demo scons -c else - scons PREFIX=$1 DEBUG=1 install - scons PREFIX=$1-release BUILD_DIR=build-release install + scons PREFIX=$1 DEBUG=1 $OPT install + scons PREFIX=$1-release $OPT BUILD_DIR=build-release install cd demo scons fi diff --git a/src/SConstruct b/src/SConstruct index 3df6842..5f1ce6a 100644 --- a/src/SConstruct +++ b/src/SConstruct @@ -9,6 +9,7 @@ version = '0.1.0' # user options DEBUG = ARGUMENTS.get('DEBUG', 0) +WITH_FULL_UNICODE_FONT = ARGUMENTS.get('WITH_FULL_UNICODE_FONT', 0) opts = Variables(name + '.conf') opts.Add(PathVariable('PREFIX', 'Directory to install under', '/usr/local', PathVariable.PathAccept)) @@ -30,6 +31,9 @@ if int(DEBUG): else: flags += ' -O3 ' +if int(WITH_FULL_UNICODE_FONT): + flags += ' -DWITH_FULL_UNICODE_FONT' + # files lists diff --git a/src/blob.S b/src/blob.S index 19b56cd..8f5e6ad 100644 --- a/src/blob.S +++ b/src/blob.S @@ -7,7 +7,9 @@ heliBlobDefaultFont: .incbin "src/data/canada1500-rg.ttf" 1: heliBlobUnicodeFont: +#ifdef WITH_FULL_UNICODE_FONT .incbin "src/data/unifont.ttf" +#endif 2: heliBlobDefaultFontSize: .int 1b - heliBlobDefaultFont diff --git a/src/font.c b/src/font.c index 3a3786d..958d2b5 100644 --- a/src/font.c +++ b/src/font.c @@ -357,9 +357,9 @@ TextLayout createTextLayout(const char *text) { HeliDrawingState *drawingState = heliDrawingGetState(); - if (!defaultFont) + if (!defaultFont && heliBlobDefaultFontSize) defaultFont = createFontFromMemory(heliBlobDefaultFont, heliBlobDefaultFontSize); - if (!unicodeFont) + if (!unicodeFont && heliBlobUnicodeFontSize) unicodeFont = createFontFromMemory(heliBlobUnicodeFont, heliBlobUnicodeFontSize); HeliFontInstance *fonts[10]; diff --git a/win/build-win.sh b/win/build-win.sh index 0bd7f10..bd52839 100755 --- a/win/build-win.sh +++ b/win/build-win.sh @@ -9,8 +9,11 @@ source function.sh source toolchain.sh -#OPTIONS="-O3 -DNDEBUG" -OPTIONS="-g -O0" +OPTIONS="-O3 -DNDEBUG" +#OPTIONS="-g -O0" + +LIBOPTIONS= +#LIBOPTIONS="-DWITH_FULL_UNICODE_FONT" packages="zlib png freetype ogg vorbis flac mpg123 sdl2 sdl2image sdl2mixer" @@ -208,7 +211,7 @@ function build_helianthus() { local file= local srcfiles=() - local compileflags=(-Wall $OPTIONS $flags -I"$prefix/include/SDL2" -I"$prefix/include/freetype2") + local compileflags=(-Wall $OPTIONS $LIBOPTIONS $flags -I"$prefix/include/SDL2" -I"$prefix/include/freetype2") for file in ../../../src/*.c ../../../src/*.S; do local filename=$(basename "$file") srcfiles+=("$file")