Generate font layout information during build

Removed generated font code from repo to avoid duplication and make
updating fonts cleaner. The files in `assets/fonts/` are the source
of truth.
This commit is contained in:
Matt Penny 2024-11-12 02:23:08 -05:00
parent 00559b6ca3
commit 1c6efda386
45 changed files with 4045 additions and 11019 deletions

View File

@ -50,6 +50,7 @@ add_subdirectory(${VPK_DIR})
add_library(code_segment STATIC)
target_link_libraries(code_segment PRIVATE
engine
font_layout_tables
level_list
materials_core
model_lists

View File

@ -404,7 +404,7 @@ build/src/menu/cheat_codes.o: build/src/audio/clips.h
build/src/levels/intro.o: build/src/audio/clips.h build/assets/materials/images.h
build/src/levels/credits.o: build/src/audio/clips.h build/assets/materials/ui.h
build/src/menu/savefile_list.o: build/assets/materials/ui.h build/src/audio/clips.h
build/src/font/dejavusans_images.o: build/assets/materials/ui.h
build/src/font/dejavu_sans_images.o: build/assets/materials/ui.h
build/src/font/liberation_mono_images.o: build/assets/materials/ui.h
build/src/player/player.o: build/assets/models/player/chell.h build/assets/materials/static.h build/src/audio/subtitles.h
build/src/scene/ball_catcher.o: build/assets/models/props/combine_ball_catcher.h build/assets/materials/static.h build/assets/models/dynamic_animated_model_list.h
@ -567,6 +567,25 @@ build/src/audio/clips.h build/src/audio/languages.h build/src/audio/languages.c:
build/src/audio/clips.o: build/src/audio/clips.h
build/src/decor/decor_object_list.o: build/src/audio/clips.h
####################
## Fonts
####################
FONT_SOURCES = build/assets/fonts/dejavu_sans.c \
build/assets/fonts/liberation_mono.c
FONT_OBJECTS = $(patsubst %.c, %.o, $(FONT_SOURCES))
DEJAVU_SANS_JSON = $(shell find assets/fonts/dejavu_sans/ -type f -name 'dejavu_sans*.json')
LIBERATION_MONO_JSON = $(shell find assets/fonts/liberation_mono/ -type f -name 'liberation_mono*.json')
build/assets/fonts/dejavu_sans.c: tools/text/font_converter.js $(DEJAVU_SANS_JSON)
@mkdir -p $(@D)
node tools/text/font_converter.js DejaVuSans assets/fonts/dejavu_sans/ $@
build/assets/fonts/liberation_mono.c: tools/text/font_converter.js $(LIBERATION_MONO_JSON)
@mkdir -p $(@D)
node tools/text/font_converter.js LiberationMono assets/fonts/liberation_mono/ $@
####################
## Subtitles
####################
@ -594,6 +613,7 @@ build/subtitles.ld: $(SUBTITLE_OBJECTS) tools/generate_segment_ld.js
CODEOBJECTS = $(patsubst %.c, build/%.o, $(CODEFILES)) \
$(MODEL_OBJECTS) \
$(FONT_OBJECTS) \
build/assets/materials/static_mat.o \
build/assets/materials/ui_mat.o \
build/assets/materials/hud_mat.o \

View File

@ -30,6 +30,7 @@ set(GEN_SEGMENT_LD "${PROJECT_SOURCE_DIR}/tools/generate_segment_ld.js")
set(EXPORT_FBX "${PROJECT_SOURCE_DIR}/tools/models/export_fbx.py")
set(MODEL_LIST_UTILS "${PROJECT_SOURCE_DIR}/tools/models/model_list_utils.js")
add_subdirectory(fonts)
add_subdirectory(materials)
add_subdirectory(models)
add_subdirectory(sound)

View File

@ -0,0 +1,69 @@
set(FONT_CONVERTER "${PROJECT_SOURCE_DIR}/tools/text/font_converter.js")
###########
## Fonts ##
###########
set(DEJAVU_SANS_FILES
dejavu_sans/dejavu_sans_0.json
dejavu_sans/dejavu_sans_1.json
dejavu_sans/dejavu_sans_2.json
dejavu_sans/dejavu_sans_3.json
dejavu_sans/dejavu_sans_4.json
dejavu_sans/dejavu_sans_all.json
)
set(LIBERATION_MONO_FILES
liberation_mono/liberation_mono_0.json
)
function(_add_convert_font_command FONT_NAME INPUT_FILES OUTPUT_LIST)
cmake_path(
RELATIVE_PATH CMAKE_CURRENT_SOURCE_DIR
BASE_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE RELATIVE_CURRENT_DIR
)
# Use font directory name for output file
list(GET INPUT_FILES 0 FONT_DIR_NAME)
cmake_path(
GET FONT_DIR_NAME PARENT_PATH
FONT_DIR_NAME
)
set(OUTPUT_FILE "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}/${FONT_DIR_NAME}.c")
add_custom_command(
DEPENDS
${INPUT_FILES} ${FONT_CONVERTER}
OUTPUT
${OUTPUT_FILE}
COMMAND
${NodeJs_EXECUTABLE} ${FONT_CONVERTER}
${FONT_NAME} ${FONT_DIR_NAME} ${OUTPUT_FILE}
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
COMMENT
"Generating $<PATH:RELATIVE_PATH,${OUTPUT_FILE},${PROJECT_SOURCE_DIR}>"
VERBATIM
)
list(APPEND ${OUTPUT_LIST} ${OUTPUT_FILE})
return(PROPAGATE ${OUTPUT_LIST})
endfunction()
# Add commands for generating font layout information
set(FONT_FILES "")
_add_convert_font_command(DejaVuSans "${DEJAVU_SANS_FILES}" FONT_FILES)
_add_convert_font_command(LiberationMono "${LIBERATION_MONO_FILES}" FONT_FILES)
add_custom_target(fonts
DEPENDS ${FONT_FILES}
)
add_library(font_layout_tables INTERFACE)
add_dependencies(font_layout_tables fonts)
target_sources(font_layout_tables INTERFACE
${FONT_FILES}
)

View File

@ -0,0 +1,985 @@
{
"config": {
"base": 10,
"bold": 0,
"charHeight": 12,
"charSpacing": 0,
"face": "DejaVu Sans",
"italic": 0,
"lineSpacing": 0,
"size": 8,
"smooth": 1,
"textureFile": "dejavu_sans_0.png",
"textureHeight": 64,
"textureWidth": 128
},
"kerning": [
{
"amount": -1,
"first": 45,
"second": 89
},
{
"amount": -1,
"first": 187,
"second": 89
},
{
"amount": -1,
"first": 70,
"second": 46
},
{
"amount": -1,
"first": 76,
"second": 84
},
{
"amount": -1,
"first": 76,
"second": 86
},
{
"amount": -1,
"first": 76,
"second": 89
},
{
"amount": -1,
"first": 80,
"second": 46
},
{
"amount": -1,
"first": 84,
"second": 46
},
{
"amount": -1,
"first": 84,
"second": 58
},
{
"amount": -1,
"first": 84,
"second": 97
},
{
"amount": -1,
"first": 84,
"second": 99
},
{
"amount": -1,
"first": 84,
"second": 101
},
{
"amount": -1,
"first": 84,
"second": 111
},
{
"amount": -1,
"first": 84,
"second": 114
},
{
"amount": -1,
"first": 84,
"second": 115
},
{
"amount": -1,
"first": 84,
"second": 117
},
{
"amount": -1,
"first": 84,
"second": 119
},
{
"amount": -1,
"first": 84,
"second": 121
},
{
"amount": -1,
"first": 86,
"second": 46
},
{
"amount": -1,
"first": 89,
"second": 45
},
{
"amount": -1,
"first": 89,
"second": 46
},
{
"amount": -1,
"first": 89,
"second": 58
},
{
"amount": -1,
"first": 89,
"second": 97
},
{
"amount": -1,
"first": 89,
"second": 101
},
{
"amount": -1,
"first": 89,
"second": 111
},
{
"amount": -1,
"first": 89,
"second": 117
},
{
"amount": -1,
"first": 89,
"second": 171
},
{
"amount": -1,
"first": 87,
"second": 46
},
{
"amount": -1,
"first": 121,
"second": 46
}
],
"symbols": [
{
"height": 3,
"id": 39,
"width": 2,
"x": 1,
"xadvance": 3,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 3,
"id": 176,
"width": 5,
"x": 4,
"xadvance": 6,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 1,
"id": 45,
"width": 5,
"x": 10,
"xadvance": 4,
"xoffset": 0,
"y": 6,
"yoffset": 6
},
{
"height": 6,
"id": 42,
"width": 7,
"x": 16,
"xadvance": 6,
"xoffset": 0,
"y": 2,
"yoffset": 2
},
{
"height": 5,
"id": 187,
"width": 6,
"x": 24,
"xadvance": 7,
"xoffset": 1,
"y": 4,
"yoffset": 4
},
{
"height": 5,
"id": 171,
"width": 7,
"x": 31,
"xadvance": 7,
"xoffset": 0,
"y": 4,
"yoffset": 4
},
{
"height": 0,
"id": 32,
"width": 1,
"x": 39,
"xadvance": 4,
"xoffset": 0,
"y": 10,
"yoffset": 10
},
{
"height": 9,
"id": 108,
"width": 3,
"x": 41,
"xadvance": 3,
"xoffset": 1,
"y": 1,
"yoffset": 1
},
{
"height": 8,
"id": 33,
"width": 3,
"x": 45,
"xadvance": 4,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 8,
"id": 73,
"width": 3,
"x": 49,
"xadvance": 3,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 8,
"id": 105,
"width": 3,
"x": 53,
"xadvance": 3,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 6,
"id": 58,
"width": 3,
"x": 57,
"xadvance": 4,
"xoffset": 1,
"y": 4,
"yoffset": 4
},
{
"height": 1,
"id": 46,
"width": 3,
"x": 61,
"xadvance": 4,
"xoffset": 1,
"y": 9,
"yoffset": 9
},
{
"height": 6,
"id": 114,
"width": 5,
"x": 65,
"xadvance": 5,
"xoffset": 1,
"y": 4,
"yoffset": 4
},
{
"height": 9,
"id": 102,
"width": 6,
"x": 71,
"xadvance": 4,
"xoffset": 0,
"y": 1,
"yoffset": 1
},
{
"height": 8,
"id": 49,
"width": 6,
"x": 78,
"xadvance": 7,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 8,
"id": 70,
"width": 6,
"x": 85,
"xadvance": 6,
"xoffset": 1,
"y": 2,
"yoffset": 2
},
{
"height": 8,
"id": 116,
"width": 6,
"x": 92,
"xadvance": 4,
"xoffset": 0,
"y": 2,
"yoffset": 2
},
{
"height": 9,
"id": 98,
"width": 7,
"x": 99,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 1
},
{
"height": 9,
"id": 100,
"width": 7,
"x": 107,
"xadvance": 7,
"xoffset": 0,
"y": 1,
"yoffset": 1
},
{
"height": 9,
"id": 104,
"width": 7,
"x": 115,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 1
},
{
"height": 9,
"id": 107,
"width": 7,
"x": 1,
"xadvance": 6,
"xoffset": 1,
"y": 11,
"yoffset": 1
},
{
"height": 8,
"id": 50,
"width": 7,
"x": 9,
"xadvance": 7,
"xoffset": 0,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 63,
"width": 7,
"x": 17,
"xadvance": 6,
"xoffset": 0,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 66,
"width": 7,
"x": 25,
"xadvance": 8,
"xoffset": 1,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 69,
"width": 7,
"x": 33,
"xadvance": 7,
"xoffset": 1,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 76,
"width": 7,
"x": 41,
"xadvance": 6,
"xoffset": 1,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 80,
"width": 7,
"x": 49,
"xadvance": 7,
"xoffset": 1,
"y": 12,
"yoffset": 2
},
{
"height": 6,
"id": 97,
"width": 7,
"x": 57,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 4
},
{
"height": 6,
"id": 99,
"width": 7,
"x": 65,
"xadvance": 6,
"xoffset": 0,
"y": 14,
"yoffset": 4
},
{
"height": 6,
"id": 110,
"width": 7,
"x": 73,
"xadvance": 7,
"xoffset": 1,
"y": 14,
"yoffset": 4
},
{
"height": 6,
"id": 115,
"width": 7,
"x": 81,
"xadvance": 6,
"xoffset": 0,
"y": 14,
"yoffset": 4
},
{
"height": 6,
"id": 117,
"width": 7,
"x": 89,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 4
},
{
"height": 6,
"id": 122,
"width": 7,
"x": 97,
"xadvance": 6,
"xoffset": 0,
"y": 14,
"yoffset": 4
},
{
"height": 8,
"id": 48,
"width": 8,
"x": 105,
"xadvance": 7,
"xoffset": 0,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 51,
"width": 8,
"x": 114,
"xadvance": 7,
"xoffset": 0,
"y": 12,
"yoffset": 2
},
{
"height": 8,
"id": 52,
"width": 8,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 53,
"width": 8,
"x": 10,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 54,
"width": 8,
"x": 19,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 55,
"width": 8,
"x": 28,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 56,
"width": 8,
"x": 37,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 57,
"width": 8,
"x": 46,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 68,
"width": 8,
"x": 55,
"xadvance": 8,
"xoffset": 1,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 72,
"width": 8,
"x": 64,
"xadvance": 8,
"xoffset": 1,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 75,
"width": 8,
"x": 73,
"xadvance": 7,
"xoffset": 1,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 78,
"width": 8,
"x": 82,
"xadvance": 8,
"xoffset": 1,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 82,
"width": 8,
"x": 91,
"xadvance": 8,
"xoffset": 1,
"y": 21,
"yoffset": 2
},
{
"height": 8,
"id": 83,
"width": 8,
"x": 100,
"xadvance": 7,
"xoffset": 0,
"y": 21,
"yoffset": 2
},
{
"height": 6,
"id": 101,
"width": 8,
"x": 109,
"xadvance": 7,
"xoffset": 0,
"y": 23,
"yoffset": 4
},
{
"height": 6,
"id": 111,
"width": 8,
"x": 118,
"xadvance": 7,
"xoffset": 0,
"y": 23,
"yoffset": 4
},
{
"height": 6,
"id": 118,
"width": 8,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 32,
"yoffset": 4
},
{
"height": 6,
"id": 120,
"width": 8,
"x": 10,
"xadvance": 7,
"xoffset": 0,
"y": 32,
"yoffset": 4
},
{
"height": 8,
"id": 65,
"width": 9,
"x": 19,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 67,
"width": 9,
"x": 29,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 71,
"width": 9,
"x": 39,
"xadvance": 9,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 77,
"width": 9,
"x": 49,
"xadvance": 9,
"xoffset": 1,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 84,
"width": 9,
"x": 59,
"xadvance": 7,
"xoffset": -1,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 85,
"width": 9,
"x": 69,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 86,
"width": 9,
"x": 79,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 88,
"width": 9,
"x": 89,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 89,
"width": 9,
"x": 99,
"xadvance": 7,
"xoffset": -1,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 90,
"width": 9,
"x": 109,
"xadvance": 8,
"xoffset": 0,
"y": 30,
"yoffset": 2
},
{
"height": 8,
"id": 79,
"width": 10,
"x": 1,
"xadvance": 9,
"xoffset": 0,
"y": 40,
"yoffset": 2
},
{
"height": 6,
"id": 109,
"width": 10,
"x": 12,
"xadvance": 11,
"xoffset": 1,
"y": 42,
"yoffset": 4
},
{
"height": 6,
"id": 119,
"width": 10,
"x": 23,
"xadvance": 9,
"xoffset": 0,
"y": 42,
"yoffset": 4
},
{
"height": 8,
"id": 87,
"width": 12,
"x": 34,
"xadvance": 11,
"xoffset": 0,
"y": 40,
"yoffset": 2
},
{
"height": 7,
"id": 59,
"width": 4,
"x": 47,
"xadvance": 4,
"xoffset": 0,
"y": 42,
"yoffset": 4
},
{
"height": 2,
"id": 44,
"width": 4,
"x": 52,
"xadvance": 4,
"xoffset": 0,
"y": 47,
"yoffset": 9
},
{
"height": 10,
"id": 40,
"width": 5,
"x": 57,
"xadvance": 4,
"xoffset": 0,
"y": 39,
"yoffset": 1
},
{
"height": 10,
"id": 41,
"width": 5,
"x": 63,
"xadvance": 4,
"xoffset": 0,
"y": 39,
"yoffset": 1
},
{
"height": 9,
"id": 47,
"width": 5,
"x": 69,
"xadvance": 4,
"xoffset": 0,
"y": 40,
"yoffset": 2
},
{
"height": 9,
"id": 81,
"width": 10,
"x": 75,
"xadvance": 9,
"xoffset": 0,
"y": 40,
"yoffset": 2
},
{
"height": 8,
"id": 161,
"width": 3,
"x": 86,
"xadvance": 4,
"xoffset": 1,
"y": 42,
"yoffset": 4
},
{
"height": 10,
"id": 93,
"width": 4,
"x": 90,
"xadvance": 4,
"xoffset": 1,
"y": 40,
"yoffset": 2
},
{
"height": 10,
"id": 74,
"width": 5,
"x": 95,
"xadvance": 3,
"xoffset": -1,
"y": 40,
"yoffset": 2
},
{
"height": 10,
"id": 91,
"width": 5,
"x": 101,
"xadvance": 4,
"xoffset": 0,
"y": 40,
"yoffset": 2
},
{
"height": 10,
"id": 106,
"width": 5,
"x": 107,
"xadvance": 3,
"xoffset": -1,
"y": 40,
"yoffset": 2
},
{
"height": 8,
"id": 103,
"width": 7,
"x": 113,
"xadvance": 7,
"xoffset": 0,
"y": 42,
"yoffset": 4
},
{
"height": 8,
"id": 112,
"width": 7,
"x": 1,
"xadvance": 7,
"xoffset": 1,
"y": 51,
"yoffset": 4
},
{
"height": 8,
"id": 113,
"width": 7,
"x": 9,
"xadvance": 7,
"xoffset": 0,
"y": 51,
"yoffset": 4
},
{
"height": 8,
"id": 191,
"width": 7,
"x": 17,
"xadvance": 6,
"xoffset": 0,
"y": 51,
"yoffset": 4
},
{
"height": 8,
"id": 121,
"width": 8,
"x": 25,
"xadvance": 7,
"xoffset": 0,
"y": 51,
"yoffset": 4
}
]
}

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,810 @@
{
"config": {
"base": 10,
"bold": 0,
"charHeight": 12,
"charSpacing": 0,
"face": "DejaVu Sans",
"italic": 0,
"lineSpacing": 0,
"size": 8,
"smooth": 1,
"textureFile": "dejavu_sans_1.png",
"textureHeight": 64,
"textureWidth": 128
},
"kerning": [
{
"amount": -1,
"first": 221,
"second": 224
},
{
"amount": -1,
"first": 221,
"second": 225
},
{
"amount": -1,
"first": 221,
"second": 226
},
{
"amount": -1,
"first": 221,
"second": 227
},
{
"amount": -1,
"first": 221,
"second": 228
},
{
"amount": -1,
"first": 221,
"second": 229
},
{
"amount": -1,
"first": 221,
"second": 232
},
{
"amount": -1,
"first": 221,
"second": 233
},
{
"amount": -1,
"first": 221,
"second": 234
},
{
"amount": -1,
"first": 221,
"second": 235
},
{
"amount": -1,
"first": 221,
"second": 242
},
{
"amount": -1,
"first": 221,
"second": 243
},
{
"amount": -1,
"first": 221,
"second": 244
},
{
"amount": -1,
"first": 221,
"second": 245
},
{
"amount": -1,
"first": 221,
"second": 246
},
{
"amount": -1,
"first": 221,
"second": 249
},
{
"amount": -1,
"first": 221,
"second": 250
},
{
"amount": -1,
"first": 221,
"second": 251
},
{
"amount": -1,
"first": 221,
"second": 252
},
{
"amount": -1,
"first": 221,
"second": 283
}
],
"symbols": [
{
"height": 6,
"id": 305,
"width": 3,
"x": 1,
"xadvance": 3,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 10,
"id": 205,
"width": 4,
"x": 5,
"xadvance": 3,
"xoffset": 0,
"y": 1,
"yoffset": 0
},
{
"height": 10,
"id": 304,
"width": 4,
"x": 10,
"xadvance": 3,
"xoffset": 0,
"y": 1,
"yoffset": 0
},
{
"height": 9,
"id": 237,
"width": 4,
"x": 15,
"xadvance": 3,
"xoffset": 1,
"y": 2,
"yoffset": 1
},
{
"height": 10,
"id": 206,
"width": 5,
"x": 20,
"xadvance": 3,
"xoffset": -1,
"y": 1,
"yoffset": 0
},
{
"height": 9,
"id": 236,
"width": 5,
"x": 26,
"xadvance": 3,
"xoffset": -1,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 238,
"width": 5,
"x": 32,
"xadvance": 3,
"xoffset": 0,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 322,
"width": 5,
"x": 38,
"xadvance": 3,
"xoffset": 0,
"y": 2,
"yoffset": 1
},
{
"height": 8,
"id": 239,
"width": 5,
"x": 44,
"xadvance": 3,
"xoffset": 0,
"y": 3,
"yoffset": 2
},
{
"height": 10,
"id": 200,
"width": 7,
"x": 50,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 0
},
{
"height": 10,
"id": 201,
"width": 7,
"x": 58,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 0
},
{
"height": 10,
"id": 202,
"width": 7,
"x": 66,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 0
},
{
"height": 10,
"id": 229,
"width": 7,
"x": 74,
"xadvance": 7,
"xoffset": 0,
"y": 1,
"yoffset": 0
},
{
"height": 10,
"id": 282,
"width": 7,
"x": 82,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 0
},
{
"height": 9,
"id": 223,
"width": 7,
"x": 90,
"xadvance": 7,
"xoffset": 1,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 224,
"width": 7,
"x": 98,
"xadvance": 7,
"xoffset": 0,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 225,
"width": 7,
"x": 106,
"xadvance": 7,
"xoffset": 0,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 226,
"width": 7,
"x": 114,
"xadvance": 7,
"xoffset": 0,
"y": 2,
"yoffset": 1
},
{
"height": 9,
"id": 227,
"width": 7,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 241,
"width": 7,
"x": 9,
"xadvance": 7,
"xoffset": 1,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 249,
"width": 7,
"x": 17,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 250,
"width": 7,
"x": 25,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 251,
"width": 7,
"x": 33,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 259,
"width": 7,
"x": 41,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 263,
"width": 7,
"x": 49,
"xadvance": 6,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 269,
"width": 7,
"x": 57,
"xadvance": 6,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 8,
"id": 228,
"width": 7,
"x": 65,
"xadvance": 7,
"xoffset": 0,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 252,
"width": 7,
"x": 73,
"xadvance": 7,
"xoffset": 0,
"y": 15,
"yoffset": 2
},
{
"height": 11,
"id": 209,
"width": 8,
"x": 81,
"xadvance": 8,
"xoffset": 1,
"y": 12,
"yoffset": -1
},
{
"height": 9,
"id": 232,
"width": 8,
"x": 90,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 233,
"width": 8,
"x": 99,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 234,
"width": 8,
"x": 108,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 242,
"width": 8,
"x": 117,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 243,
"width": 8,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 9,
"id": 244,
"width": 8,
"x": 10,
"xadvance": 7,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 9,
"id": 245,
"width": 8,
"x": 19,
"xadvance": 7,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 9,
"id": 283,
"width": 8,
"x": 28,
"xadvance": 7,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 8,
"id": 235,
"width": 8,
"x": 37,
"xadvance": 7,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 246,
"width": 8,
"x": 46,
"xadvance": 7,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 11,
"id": 195,
"width": 9,
"x": 55,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": -1
},
{
"height": 11,
"id": 258,
"width": 9,
"x": 65,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": -1
},
{
"height": 11,
"id": 286,
"width": 9,
"x": 75,
"xadvance": 9,
"xoffset": 0,
"y": 24,
"yoffset": -1
},
{
"height": 10,
"id": 192,
"width": 9,
"x": 85,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 10,
"id": 193,
"width": 9,
"x": 95,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 10,
"id": 194,
"width": 9,
"x": 105,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 10,
"id": 196,
"width": 9,
"x": 115,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 10,
"id": 197,
"width": 9,
"x": 1,
"xadvance": 8,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 218,
"width": 9,
"x": 11,
"xadvance": 8,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 220,
"width": 9,
"x": 21,
"xadvance": 8,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 221,
"width": 9,
"x": 31,
"xadvance": 7,
"xoffset": -1,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 262,
"width": 9,
"x": 41,
"xadvance": 8,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 268,
"width": 9,
"x": 51,
"xadvance": 8,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 8,
"id": 321,
"width": 9,
"x": 61,
"xadvance": 6,
"xoffset": -1,
"y": 38,
"yoffset": 2
},
{
"height": 10,
"id": 211,
"width": 10,
"x": 71,
"xadvance": 9,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 212,
"width": 10,
"x": 82,
"xadvance": 9,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 10,
"id": 214,
"width": 10,
"x": 93,
"xadvance": 9,
"xoffset": 0,
"y": 36,
"yoffset": 0
},
{
"height": 9,
"id": 271,
"width": 10,
"x": 104,
"xadvance": 7,
"xoffset": 0,
"y": 37,
"yoffset": 1
},
{
"height": 8,
"id": 198,
"width": 12,
"x": 1,
"xadvance": 11,
"xoffset": 0,
"y": 48,
"yoffset": 2
},
{
"height": 6,
"id": 230,
"width": 12,
"x": 14,
"xadvance": 11,
"xoffset": 0,
"y": 50,
"yoffset": 4
},
{
"height": 8,
"id": 248,
"width": 8,
"x": 27,
"xadvance": 7,
"xoffset": 0,
"y": 49,
"yoffset": 3
},
{
"height": 10,
"id": 216,
"width": 10,
"x": 36,
"xadvance": 9,
"xoffset": 0,
"y": 47,
"yoffset": 1
},
{
"height": 11,
"id": 287,
"width": 7,
"x": 47,
"xadvance": 7,
"xoffset": 0,
"y": 47,
"yoffset": 1
},
{
"height": 10,
"id": 280,
"width": 7,
"x": 55,
"xadvance": 7,
"xoffset": 1,
"y": 48,
"yoffset": 2
},
{
"height": 8,
"id": 231,
"width": 7,
"x": 63,
"xadvance": 6,
"xoffset": 0,
"y": 50,
"yoffset": 4
},
{
"height": 8,
"id": 261,
"width": 7,
"x": 71,
"xadvance": 7,
"xoffset": 0,
"y": 50,
"yoffset": 4
},
{
"height": 11,
"id": 253,
"width": 8,
"x": 79,
"xadvance": 7,
"xoffset": 0,
"y": 47,
"yoffset": 1
},
{
"height": 8,
"id": 281,
"width": 8,
"x": 88,
"xadvance": 7,
"xoffset": 0,
"y": 50,
"yoffset": 4
},
{
"height": 10,
"id": 199,
"width": 9,
"x": 97,
"xadvance": 8,
"xoffset": 0,
"y": 48,
"yoffset": 2
},
{
"height": 10,
"id": 260,
"width": 9,
"x": 107,
"xadvance": 8,
"xoffset": 0,
"y": 48,
"yoffset": 2
}
]
}

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,650 @@
{
"config": {
"base": 10,
"bold": 0,
"charHeight": 12,
"charSpacing": 0,
"face": "DejaVu Sans",
"italic": 0,
"lineSpacing": 0,
"size": 8,
"smooth": 1,
"textureFile": "dejavu_sans_2.png",
"textureHeight": 64,
"textureWidth": 128
},
"kerning": [
],
"symbols": [
{
"height": 8,
"id": 921,
"width": 3,
"x": 1,
"xadvance": 3,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 9,
"id": 345,
"width": 5,
"x": 5,
"xadvance": 5,
"xoffset": 1,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 906,
"width": 5,
"x": 11,
"xadvance": 4,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 943,
"width": 5,
"x": 17,
"xadvance": 4,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 357,
"width": 6,
"x": 23,
"xadvance": 4,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 11,
"id": 944,
"width": 7,
"x": 30,
"xadvance": 6,
"xoffset": 0,
"y": 1,
"yoffset": -1
},
{
"height": 10,
"id": 367,
"width": 7,
"x": 38,
"xadvance": 7,
"xoffset": 0,
"y": 2,
"yoffset": 0
},
{
"height": 9,
"id": 324,
"width": 7,
"x": 46,
"xadvance": 7,
"xoffset": 1,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 328,
"width": 7,
"x": 54,
"xadvance": 7,
"xoffset": 1,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 347,
"width": 7,
"x": 62,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 353,
"width": 7,
"x": 70,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 378,
"width": 7,
"x": 78,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 382,
"width": 7,
"x": 86,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 941,
"width": 7,
"x": 94,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 8,
"id": 380,
"width": 7,
"x": 102,
"xadvance": 6,
"xoffset": 0,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 914,
"width": 7,
"x": 110,
"xadvance": 8,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 915,
"width": 7,
"x": 118,
"xadvance": 6,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 917,
"width": 7,
"x": 1,
"xadvance": 7,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 926,
"width": 7,
"x": 9,
"xadvance": 7,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 929,
"width": 7,
"x": 17,
"xadvance": 7,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 931,
"width": 7,
"x": 25,
"xadvance": 7,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 10,
"id": 323,
"width": 8,
"x": 33,
"xadvance": 8,
"xoffset": 1,
"y": 13,
"yoffset": 0
},
{
"height": 10,
"id": 327,
"width": 8,
"x": 42,
"xadvance": 8,
"xoffset": 1,
"y": 13,
"yoffset": 0
},
{
"height": 10,
"id": 344,
"width": 8,
"x": 51,
"xadvance": 8,
"xoffset": 1,
"y": 13,
"yoffset": 0
},
{
"height": 10,
"id": 346,
"width": 8,
"x": 60,
"xadvance": 7,
"xoffset": 0,
"y": 13,
"yoffset": 0
},
{
"height": 10,
"id": 352,
"width": 8,
"x": 69,
"xadvance": 7,
"xoffset": 0,
"y": 13,
"yoffset": 0
},
{
"height": 9,
"id": 337,
"width": 8,
"x": 78,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 369,
"width": 8,
"x": 87,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 9,
"id": 940,
"width": 8,
"x": 96,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 1
},
{
"height": 8,
"id": 919,
"width": 8,
"x": 105,
"xadvance": 8,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 922,
"width": 8,
"x": 114,
"xadvance": 7,
"xoffset": 1,
"y": 15,
"yoffset": 2
},
{
"height": 8,
"id": 925,
"width": 8,
"x": 1,
"xadvance": 8,
"xoffset": 1,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 928,
"width": 8,
"x": 10,
"xadvance": 8,
"xoffset": 1,
"y": 27,
"yoffset": 2
},
{
"height": 11,
"id": 366,
"width": 9,
"x": 19,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": -1
},
{
"height": 10,
"id": 379,
"width": 9,
"x": 29,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 10,
"id": 381,
"width": 9,
"x": 39,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 0
},
{
"height": 9,
"id": 902,
"width": 9,
"x": 49,
"xadvance": 8,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 9,
"id": 904,
"width": 9,
"x": 59,
"xadvance": 8,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 9,
"id": 911,
"width": 9,
"x": 69,
"xadvance": 9,
"xoffset": 0,
"y": 26,
"yoffset": 1
},
{
"height": 8,
"id": 913,
"width": 9,
"x": 79,
"xadvance": 8,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 916,
"width": 9,
"x": 89,
"xadvance": 8,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 918,
"width": 9,
"x": 99,
"xadvance": 8,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 923,
"width": 9,
"x": 109,
"xadvance": 8,
"xoffset": 0,
"y": 27,
"yoffset": 2
},
{
"height": 8,
"id": 924,
"width": 9,
"x": 1,
"xadvance": 9,
"xoffset": 1,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 932,
"width": 9,
"x": 11,
"xadvance": 7,
"xoffset": -1,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 933,
"width": 9,
"x": 21,
"xadvance": 7,
"xoffset": -1,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 935,
"width": 9,
"x": 31,
"xadvance": 8,
"xoffset": 0,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 937,
"width": 9,
"x": 41,
"xadvance": 8,
"xoffset": 0,
"y": 39,
"yoffset": 2
},
{
"height": 11,
"id": 213,
"width": 10,
"x": 51,
"xadvance": 9,
"xoffset": 0,
"y": 36,
"yoffset": -1
},
{
"height": 10,
"id": 336,
"width": 10,
"x": 62,
"xadvance": 9,
"xoffset": 0,
"y": 37,
"yoffset": 0
},
{
"height": 9,
"id": 905,
"width": 10,
"x": 73,
"xadvance": 10,
"xoffset": 0,
"y": 38,
"yoffset": 1
},
{
"height": 9,
"id": 908,
"width": 10,
"x": 84,
"xadvance": 9,
"xoffset": 0,
"y": 38,
"yoffset": 1
},
{
"height": 8,
"id": 920,
"width": 10,
"x": 95,
"xadvance": 9,
"xoffset": 0,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 927,
"width": 10,
"x": 106,
"xadvance": 9,
"xoffset": 0,
"y": 39,
"yoffset": 2
},
{
"height": 8,
"id": 934,
"width": 10,
"x": 1,
"xadvance": 9,
"xoffset": 0,
"y": 49,
"yoffset": 2
},
{
"height": 10,
"id": 355,
"width": 6,
"x": 12,
"xadvance": 4,
"xoffset": 0,
"y": 49,
"yoffset": 2
},
{
"height": 11,
"id": 942,
"width": 7,
"x": 19,
"xadvance": 7,
"xoffset": 1,
"y": 48,
"yoffset": 1
},
{
"height": 8,
"id": 351,
"width": 7,
"x": 27,
"xadvance": 6,
"xoffset": 0,
"y": 51,
"yoffset": 4
},
{
"height": 10,
"id": 350,
"width": 8,
"x": 35,
"xadvance": 7,
"xoffset": 0,
"y": 49,
"yoffset": 2
},
{
"height": 10,
"id": 354,
"width": 9,
"x": 44,
"xadvance": 7,
"xoffset": -1,
"y": 49,
"yoffset": 2
},
{
"height": 11,
"id": 539,
"width": 6,
"x": 54,
"xadvance": 4,
"xoffset": 0,
"y": 49,
"yoffset": 2
},
{
"height": 9,
"id": 537,
"width": 7,
"x": 61,
"xadvance": 6,
"xoffset": 0,
"y": 51,
"yoffset": 4
},
{
"height": 11,
"id": 538,
"width": 9,
"x": 69,
"xadvance": 7,
"xoffset": -1,
"y": 49,
"yoffset": 2
}
]
}

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,600 @@
{
"config": {
"base": 10,
"bold": 0,
"charHeight": 12,
"charSpacing": 0,
"face": "DejaVu Sans",
"italic": 0,
"lineSpacing": 0,
"size": 8,
"smooth": 1,
"textureFile": "dejavu_sans_3.png",
"textureHeight": 64,
"textureWidth": 128
},
"kerning": [
],
"symbols": [
{
"height": 8,
"id": 1030,
"width": 3,
"x": 1,
"xadvance": 3,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 10,
"id": 1031,
"width": 5,
"x": 5,
"xadvance": 3,
"xoffset": -1,
"y": 2,
"yoffset": 0
},
{
"height": 6,
"id": 953,
"width": 5,
"x": 11,
"xadvance": 4,
"xoffset": 0,
"y": 6,
"yoffset": 4
},
{
"height": 9,
"id": 973,
"width": 7,
"x": 17,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 8,
"id": 971,
"width": 7,
"x": 25,
"xadvance": 6,
"xoffset": 0,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 1041,
"width": 7,
"x": 33,
"xadvance": 8,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 1042,
"width": 7,
"x": 41,
"xadvance": 8,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 1043,
"width": 7,
"x": 49,
"xadvance": 7,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 1045,
"width": 7,
"x": 57,
"xadvance": 7,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 8,
"id": 1056,
"width": 7,
"x": 65,
"xadvance": 7,
"xoffset": 1,
"y": 4,
"yoffset": 2
},
{
"height": 6,
"id": 949,
"width": 7,
"x": 73,
"xadvance": 6,
"xoffset": 0,
"y": 6,
"yoffset": 4
},
{
"height": 6,
"id": 954,
"width": 7,
"x": 81,
"xadvance": 6,
"xoffset": 1,
"y": 6,
"yoffset": 4
},
{
"height": 6,
"id": 957,
"width": 7,
"x": 89,
"xadvance": 6,
"xoffset": 0,
"y": 6,
"yoffset": 4
},
{
"height": 6,
"id": 965,
"width": 7,
"x": 97,
"xadvance": 6,
"xoffset": 0,
"y": 6,
"yoffset": 4
},
{
"height": 11,
"id": 1049,
"width": 8,
"x": 105,
"xadvance": 8,
"xoffset": 1,
"y": 1,
"yoffset": -1
},
{
"height": 9,
"id": 952,
"width": 8,
"x": 114,
"xadvance": 7,
"xoffset": 0,
"y": 3,
"yoffset": 1
},
{
"height": 9,
"id": 955,
"width": 8,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 13,
"yoffset": 1
},
{
"height": 9,
"id": 972,
"width": 8,
"x": 10,
"xadvance": 7,
"xoffset": 0,
"y": 13,
"yoffset": 1
},
{
"height": 8,
"id": 948,
"width": 8,
"x": 19,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1047,
"width": 8,
"x": 28,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1048,
"width": 8,
"x": 37,
"xadvance": 8,
"xoffset": 1,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1050,
"width": 8,
"x": 46,
"xadvance": 8,
"xoffset": 1,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1053,
"width": 8,
"x": 55,
"xadvance": 8,
"xoffset": 1,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1055,
"width": 8,
"x": 64,
"xadvance": 8,
"xoffset": 1,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1059,
"width": 8,
"x": 73,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1063,
"width": 8,
"x": 82,
"xadvance": 8,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 6,
"id": 945,
"width": 8,
"x": 91,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 959,
"width": 8,
"x": 100,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 960,
"width": 8,
"x": 109,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 963,
"width": 8,
"x": 118,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 964,
"width": 8,
"x": 1,
"xadvance": 7,
"xoffset": 0,
"y": 26,
"yoffset": 4
},
{
"height": 8,
"id": 1028,
"width": 9,
"x": 10,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1040,
"width": 9,
"x": 20,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1051,
"width": 9,
"x": 30,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1052,
"width": 9,
"x": 40,
"xadvance": 9,
"xoffset": 1,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1057,
"width": 9,
"x": 50,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1058,
"width": 9,
"x": 60,
"xadvance": 7,
"xoffset": -1,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1061,
"width": 9,
"x": 70,
"xadvance": 8,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 9,
"id": 974,
"width": 10,
"x": 80,
"xadvance": 9,
"xoffset": 0,
"y": 23,
"yoffset": 1
},
{
"height": 8,
"id": 1054,
"width": 10,
"x": 91,
"xadvance": 9,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 8,
"id": 1060,
"width": 10,
"x": 102,
"xadvance": 9,
"xoffset": 0,
"y": 24,
"yoffset": 2
},
{
"height": 6,
"id": 969,
"width": 10,
"x": 113,
"xadvance": 9,
"xoffset": 0,
"y": 26,
"yoffset": 4
},
{
"height": 8,
"id": 1064,
"width": 11,
"x": 1,
"xadvance": 12,
"xoffset": 1,
"y": 34,
"yoffset": 2
},
{
"height": 8,
"id": 1046,
"width": 13,
"x": 13,
"xadvance": 12,
"xoffset": 0,
"y": 34,
"yoffset": 2
},
{
"height": 11,
"id": 946,
"width": 7,
"x": 27,
"xadvance": 7,
"xoffset": 1,
"y": 33,
"yoffset": 1
},
{
"height": 11,
"id": 950,
"width": 7,
"x": 35,
"xadvance": 6,
"xoffset": 0,
"y": 33,
"yoffset": 1
},
{
"height": 11,
"id": 958,
"width": 7,
"x": 43,
"xadvance": 6,
"xoffset": 0,
"y": 33,
"yoffset": 1
},
{
"height": 8,
"id": 951,
"width": 7,
"x": 51,
"xadvance": 7,
"xoffset": 1,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 961,
"width": 7,
"x": 59,
"xadvance": 7,
"xoffset": 1,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 962,
"width": 7,
"x": 67,
"xadvance": 6,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 947,
"width": 8,
"x": 75,
"xadvance": 7,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 956,
"width": 8,
"x": 84,
"xadvance": 7,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 966,
"width": 8,
"x": 93,
"xadvance": 7,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 967,
"width": 8,
"x": 102,
"xadvance": 6,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 8,
"id": 968,
"width": 8,
"x": 111,
"xadvance": 7,
"xoffset": 0,
"y": 36,
"yoffset": 4
},
{
"height": 10,
"id": 1062,
"width": 9,
"x": 1,
"xadvance": 9,
"xoffset": 1,
"y": 45,
"yoffset": 2
},
{
"height": 10,
"id": 1044,
"width": 10,
"x": 11,
"xadvance": 9,
"xoffset": 0,
"y": 45,
"yoffset": 2
},
{
"height": 10,
"id": 1065,
"width": 12,
"x": 22,
"xadvance": 12,
"xoffset": 1,
"y": 45,
"yoffset": 2
}
]
}

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,530 @@
{
"config": {
"base": 10,
"bold": 0,
"charHeight": 12,
"charSpacing": 0,
"face": "DejaVu Sans",
"italic": 0,
"lineSpacing": 0,
"size": 8,
"smooth": 1,
"textureFile": "dejavu_sans_4.png",
"textureHeight": 64,
"textureWidth": 128
},
"kerning": [
],
"symbols": [
{
"height": 2,
"id": 8217,
"width": 4,
"x": 1,
"xadvance": 4,
"xoffset": 0,
"y": 3,
"yoffset": 2
},
{
"height": 2,
"id": 8220,
"width": 6,
"x": 6,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 2
},
{
"height": 2,
"id": 8221,
"width": 6,
"x": 13,
"xadvance": 6,
"xoffset": 0,
"y": 3,
"yoffset": 2
},
{
"height": 1,
"id": 8211,
"width": 6,
"x": 20,
"xadvance": 6,
"xoffset": 0,
"y": 8,
"yoffset": 7
},
{
"height": 1,
"id": 8212,
"width": 12,
"x": 27,
"xadvance": 11,
"xoffset": 0,
"y": 8,
"yoffset": 7
},
{
"height": 8,
"id": 1110,
"width": 3,
"x": 40,
"xadvance": 3,
"xoffset": 1,
"y": 3,
"yoffset": 2
},
{
"height": 8,
"id": 1111,
"width": 5,
"x": 44,
"xadvance": 3,
"xoffset": 0,
"y": 3,
"yoffset": 2
},
{
"height": 6,
"id": 1074,
"width": 6,
"x": 50,
"xadvance": 6,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1075,
"width": 6,
"x": 57,
"xadvance": 6,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1100,
"width": 6,
"x": 64,
"xadvance": 6,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 10,
"id": 1168,
"width": 7,
"x": 71,
"xadvance": 7,
"xoffset": 1,
"y": 1,
"yoffset": 0
},
{
"height": 9,
"id": 1081,
"width": 7,
"x": 79,
"xadvance": 7,
"xoffset": 1,
"y": 2,
"yoffset": 1
},
{
"height": 8,
"id": 1068,
"width": 7,
"x": 87,
"xadvance": 8,
"xoffset": 1,
"y": 3,
"yoffset": 2
},
{
"height": 6,
"id": 1072,
"width": 7,
"x": 95,
"xadvance": 7,
"xoffset": 0,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1079,
"width": 7,
"x": 103,
"xadvance": 6,
"xoffset": 0,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1080,
"width": 7,
"x": 111,
"xadvance": 7,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1082,
"width": 7,
"x": 119,
"xadvance": 7,
"xoffset": 1,
"y": 5,
"yoffset": 4
},
{
"height": 6,
"id": 1085,
"width": 7,
"x": 1,
"xadvance": 7,
"xoffset": 1,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1087,
"width": 7,
"x": 9,
"xadvance": 7,
"xoffset": 1,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1089,
"width": 7,
"x": 17,
"xadvance": 6,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1095,
"width": 7,
"x": 25,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1101,
"width": 7,
"x": 33,
"xadvance": 6,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1103,
"width": 7,
"x": 41,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1108,
"width": 7,
"x": 49,
"xadvance": 6,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 10,
"id": 1073,
"width": 8,
"x": 57,
"xadvance": 7,
"xoffset": 0,
"y": 12,
"yoffset": 0
},
{
"height": 8,
"id": 1071,
"width": 8,
"x": 66,
"xadvance": 8,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 8,
"id": 1105,
"width": 8,
"x": 75,
"xadvance": 7,
"xoffset": 0,
"y": 14,
"yoffset": 2
},
{
"height": 6,
"id": 1077,
"width": 8,
"x": 84,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1083,
"width": 8,
"x": 93,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1084,
"width": 8,
"x": 102,
"xadvance": 8,
"xoffset": 1,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1086,
"width": 8,
"x": 111,
"xadvance": 7,
"xoffset": 0,
"y": 16,
"yoffset": 4
},
{
"height": 6,
"id": 1090,
"width": 8,
"x": 1,
"xadvance": 6,
"xoffset": 0,
"y": 25,
"yoffset": 4
},
{
"height": 6,
"id": 1093,
"width": 8,
"x": 10,
"xadvance": 7,
"xoffset": 0,
"y": 25,
"yoffset": 4
},
{
"height": 8,
"id": 1067,
"width": 9,
"x": 19,
"xadvance": 10,
"xoffset": 1,
"y": 23,
"yoffset": 2
},
{
"height": 8,
"id": 1069,
"width": 9,
"x": 29,
"xadvance": 8,
"xoffset": 0,
"y": 23,
"yoffset": 2
},
{
"height": 6,
"id": 1098,
"width": 9,
"x": 39,
"xadvance": 8,
"xoffset": 0,
"y": 25,
"yoffset": 4
},
{
"height": 6,
"id": 1099,
"width": 9,
"x": 49,
"xadvance": 9,
"xoffset": 1,
"y": 25,
"yoffset": 4
},
{
"height": 6,
"id": 1102,
"width": 9,
"x": 59,
"xadvance": 9,
"xoffset": 1,
"y": 25,
"yoffset": 4
},
{
"height": 8,
"id": 936,
"width": 10,
"x": 69,
"xadvance": 9,
"xoffset": 0,
"y": 23,
"yoffset": 2
},
{
"height": 8,
"id": 1066,
"width": 10,
"x": 80,
"xadvance": 9,
"xoffset": 0,
"y": 23,
"yoffset": 2
},
{
"height": 6,
"id": 1096,
"width": 10,
"x": 91,
"xadvance": 10,
"xoffset": 1,
"y": 25,
"yoffset": 4
},
{
"height": 1,
"id": 8230,
"width": 10,
"x": 102,
"xadvance": 11,
"xoffset": 1,
"y": 30,
"yoffset": 9
},
{
"height": 6,
"id": 1078,
"width": 11,
"x": 113,
"xadvance": 10,
"xoffset": 0,
"y": 25,
"yoffset": 4
},
{
"height": 8,
"id": 1070,
"width": 12,
"x": 1,
"xadvance": 12,
"xoffset": 1,
"y": 33,
"yoffset": 2
},
{
"height": 2,
"id": 8222,
"width": 6,
"x": 14,
"xadvance": 6,
"xoffset": 0,
"y": 40,
"yoffset": 9
},
{
"height": 8,
"id": 1088,
"width": 7,
"x": 21,
"xadvance": 7,
"xoffset": 1,
"y": 35,
"yoffset": 4
},
{
"height": 8,
"id": 1094,
"width": 7,
"x": 29,
"xadvance": 7,
"xoffset": 1,
"y": 35,
"yoffset": 4
},
{
"height": 8,
"id": 1091,
"width": 8,
"x": 37,
"xadvance": 7,
"xoffset": 0,
"y": 35,
"yoffset": 4
},
{
"height": 8,
"id": 1076,
"width": 9,
"x": 46,
"xadvance": 8,
"xoffset": 0,
"y": 35,
"yoffset": 4
},
{
"height": 11,
"id": 1092,
"width": 10,
"x": 56,
"xadvance": 9,
"xoffset": 0,
"y": 32,
"yoffset": 1
},
{
"height": 8,
"id": 1097,
"width": 10,
"x": 67,
"xadvance": 10,
"xoffset": 1,
"y": 35,
"yoffset": 4
}
]
}

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,5 @@
Below are the characters used in each of the font pages
Note that the space charcter is intentionally left in the first group
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,101 @@
Digitized data copyright (c) 2010 Google Corporation
with Reserved Font Arimo, Tinos and Cousine.
Copyright (c) 2012 Red Hat, Inc.
with Reserved Font Name Liberation.
This Font Software is licensed under the SIL Open Font License,
Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
PREAMBLE The goals of the Open Font License (OFL) are to stimulate
worldwide development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to provide
a free and open framework in which fonts may be shared and improved in
partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves.
The fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such.
This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components
as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting ? in part or in whole ?
any of the components of the Original Version, by changing formats or
by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer
or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a
copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,in
Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole, must
be distributed entirely under this license, and must not be distributed
under any other license. The requirement for fonts to remain under
this license does not apply to any document created using the Font
Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
DEALINGS IN THE FONT SOFTWARE.

View File

@ -455,12 +455,12 @@ set_property(SOURCE images.skm.yaml
set_property(SOURCE ui.skm.yaml
PROPERTY ADDITIONAL_DEPS
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_0.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_1.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_2.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_3.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_4.png
${PROJECT_SOURCE_DIR}/assets/fonts/liberation_mono_0.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_0.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_1.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_2.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_3.png
${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_4.png
${PROJECT_SOURCE_DIR}/assets/fonts/liberation_mono/liberation_mono_0.png
${PROJECT_SOURCE_DIR}/assets/images/button_icons.png
${PROJECT_SOURCE_DIR}/assets/images/credits_icons.png
${PROJECT_SOURCE_DIR}/assets/images/github_qr.png

View File

@ -12,7 +12,7 @@ materials:
dejavu_sans_0:
gDPSetTile:
filename: "../fonts/dejavu_sans_0.png"
filename: "../fonts/dejavu_sans/dejavu_sans_0.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:
@ -27,7 +27,7 @@ materials:
dejavu_sans_1:
gDPSetTile:
filename: "../fonts/dejavu_sans_1.png"
filename: "../fonts/dejavu_sans/dejavu_sans_1.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:
@ -42,7 +42,7 @@ materials:
dejavu_sans_2:
gDPSetTile:
filename: "../fonts/dejavu_sans_2.png"
filename: "../fonts/dejavu_sans/dejavu_sans_2.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:
@ -57,7 +57,7 @@ materials:
dejavu_sans_3:
gDPSetTile:
filename: "../fonts/dejavu_sans_3.png"
filename: "../fonts/dejavu_sans/dejavu_sans_3.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:
@ -72,7 +72,7 @@ materials:
dejavu_sans_4:
gDPSetTile:
filename: "../fonts/dejavu_sans_4.png"
filename: "../fonts/dejavu_sans/dejavu_sans_4.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:
@ -87,7 +87,7 @@ materials:
liberation_mono_0:
gDPSetTile:
filename: "../fonts/liberation_mono_0.png"
filename: "../fonts/liberation_mono/liberation_mono_0.png"
siz: G_IM_SIZ_4b
fmt: G_IM_FMT_I
gDPSetCombineMode:

View File

@ -16,7 +16,7 @@ set(STRINGS
set(STRING_DEPENDENCIES
${STRINGS}
"${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans_book_8.json"
"${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_all.json"
)
# TODO: rename/relocate somewhere else. "Subtitles" also contain UI strings.

View File

@ -31,10 +31,8 @@ target_sources(engine INTERFACE
effects/effects.c
effects/portal_trail.c
effects/splash_particle_effect.c
font/dejavusans.c
font/dejavusans_images.c
font/dejavu_sans_images.c
font/font.c
font/liberation_mono.c
font/liberation_mono_images.c
graphics/color.c
graphics/debug_render.c

View File

@ -0,0 +1,11 @@
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"
Gfx* gDejaVuSansImages[] = {
ui_dejavu_sans_0,
ui_dejavu_sans_1,
ui_dejavu_sans_2,
ui_dejavu_sans_3,
ui_dejavu_sans_4,
};

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#include "dejavusans.h"
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#include "dejavusans.h"
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"

View File

@ -2,7 +2,7 @@
#include "../system/controller.h"
#include "../savefile/savefile.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../audio/soundplayer.h"
#include "../build/src/audio/subtitles.h"
#include "../build/src/audio/languages.h"

View File

@ -1,6 +1,6 @@
#include "./confirmation_dialog.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../system/controller.h"
#include "../audio/soundplayer.h"
#include "./translations.h"

View File

@ -1,6 +1,6 @@
#include "controls.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../font/font.h"
#include "../system/controller.h"
#include "../audio/soundplayer.h"

View File

@ -1,7 +1,7 @@
#include "gameplay_options.h"
#include "../system/controller.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../audio/soundplayer.h"
#include "../savefile/savefile.h"

View File

@ -1,7 +1,7 @@
#include "joystick_options.h"
#include "../system/controller.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../audio/soundplayer.h"
#include "../savefile/savefile.h"

View File

@ -1,7 +1,7 @@
#include "landing_menu.h"
#include "../font/font.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../system/controller.h"
#include "../util/memory.h"
#include "../audio/soundplayer.h"

View File

@ -7,7 +7,7 @@
#include "system/time.h"
#include "../math/mathf.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"

View File

@ -3,7 +3,7 @@
#include "./translations.h"
#include "../font/font.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../graphics/image.h"
#include "../util/memory.h"

View File

@ -1,7 +1,7 @@
#include "options_menu.h"
#include "../font/font.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../savefile/savefile.h"

View File

@ -1,6 +1,6 @@
#include "./savefile_list.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "../system/controller.h"
#include "../util/rom.h"
#include "../graphics/image.h"

View File

@ -1,6 +1,6 @@
#include "video_options.h"
#include "../font/dejavusans.h"
#include "../font/dejavu_sans.h"
#include "./translations.h"
#include "../savefile/savefile.h"
#include "../main.h"

View File

@ -1,186 +0,0 @@
// this tool takes a the json output from https://github.com/andryblack/fontbuilder and create a font usabe in portal64
// usage
// generate multiple font files with each image not being larger than 4kb
// then name the files font_file_0.json, font_file_1.json, font_file_2.json
// you also need a json file with all the characters in a single file called font_file_all.json
// this all file is only needed to extract the kerning
// once you have that use this as follows
//
// node tools/font_converter.js FontName /path/to/font_file /path/to/output.c
const fs = require('fs');
const name = process.argv[2];
const filePrefix = process.argv[3];
const joinedSymbols = [];
let index = 0;
while (index < 100) {
const filename = `${filePrefix}_${index}.json`;
if (!fs.existsSync(filename)) {
break;
}
const singleInput = JSON.parse(fs.readFileSync(filename));
singleInput.symbols.forEach((symbol) => {
joinedSymbols.push({
...symbol,
textureIndex: index,
});
});
++index;
}
const allSymbols = JSON.parse(fs.readFileSync(`${filePrefix}_all.json`));
const input = {
kerning: allSymbols.kerning,
config: allSymbols.config,
symbols: joinedSymbols,
};
function kerningHashFunction(kerning, multiplier, arraySize) {
return ((kerning.first * multiplier) + kerning.second) % arraySize;
}
function symbolHashFunction(symbol, multiplier, arraySize) {
return (symbol.id * multiplier) % arraySize;
}
function checkForCollisions(list, hashFunction, multiplier, arraySize, emptyObj) {
const sparseArray = [];
sparseArray.length = arraySize;
if (arraySize < list.length) {
return null;
}
let maxCollisions = 0;
let averageCollisions = 0;
for (const element of list) {
let index = hashFunction(element, multiplier, arraySize);
let currentCollisions = 0;
while (sparseArray[index]) {
index = (index + 1) % arraySize;
currentCollisions = currentCollisions + 1;
}
maxCollisions = Math.max(maxCollisions, currentCollisions);
averageCollisions += currentCollisions;
sparseArray[index] = element;
}
averageCollisions /= list.length;
for (let i = 0; i < arraySize; ++i) {
if (!sparseArray[i]) {
sparseArray[i] = emptyObj;
}
}
return {sparseArray, maxCollisions, averageCollisions};
}
function searchForBestHashTable(list, hashFunction, emptyObj) {
let result;
let multiplier;
let arraySize = 1;
let mask = 1;
while (arraySize < list.length) {
arraySize *= 2;
mask <<= 1;
}
arraySize *= 2;
mask <<= 1;
for (let i = 1; i < 0x10000; ++i) {
const check = checkForCollisions(list, hashFunction, i, arraySize, emptyObj);
if (!result || check.maxCollisions < result.maxCollisions) {
result = check
multiplier = i;
}
}
mask -= 1;
return {result: result.sparseArray, multiplier: multiplier, mask: mask, maxCollisions: result.maxCollisions, averageCollisions: result.averageCollisions};
}
function buildKerning(kerningList) {
return `struct FontKerning g${name}Kerning[] = {
${kerningList.map(kerning => ` {.amount = ${kerning.amount}, .first = ${kerning.first}, .second = ${kerning.second}},`).join('\n')}
};
`
}
function buildFont(kerningResult, symbolResult) {
return `struct Font g${name}Font = {
.kerning = &g${name}Kerning[0],
.symbols = &g${name}Symbols[0],
.base = ${input.config.base},
.charHeight = ${input.config.charHeight},
.symbolMultiplier = ${symbolResult.multiplier},
.symbolMask = 0x${symbolResult.mask.toString(16)},
.symbolMaxCollisions = ${symbolResult.maxCollisions},
.kerningMultiplier = ${kerningResult.multiplier},
.kerningMask = 0x${kerningResult.mask.toString(16)},
.kerningMaxCollisions = ${kerningResult.maxCollisions},
};
`
}
function buildSymbol(symbol) {
return ` {
.id = ${symbol.id},
.x = ${symbol.x}, .y = ${symbol.y},
.width = ${symbol.width}, .height = ${symbol.height},
.xoffset = ${symbol.xoffset}, .yoffset = ${symbol.yoffset},
.xadvance = ${symbol.xadvance},
.textureIndex = ${symbol.textureIndex},
},`
}
const kerningResult = searchForBestHashTable(
input.kerning,
kerningHashFunction,
{amount: 0, first: 0, second: 0}
);
const symbolResult = searchForBestHashTable(
input.symbols,
symbolHashFunction,
{id: 0, x: 0, y: 0, width: 0, height: 0, xoffset: 0, yoffset: 0, xadvance: 0, textureIndex: -1}
);
console.log(`symbolLength = ${input.symbols.length}/${symbolResult.result.length}`);
console.log(`symbolMaxCollisions = ${symbolResult.maxCollisions}`);
console.log(`symbolAverageCollisions = ${symbolResult.averageCollisions}`);
console.log(`kerningLength = ${input.kerning.length}/${kerningResult.result.length}`);
console.log(`maxKerningCollisions = ${kerningResult.maxCollisions}`);
console.log(`kerningAverageCollisions = ${kerningResult.averageCollisions}`);
fs.writeFileSync(process.argv[4], `
#include "font.h"
${buildKerning(kerningResult.result)}
struct FontSymbol g${name}Symbols[] = {
${symbolResult.result.map(buildSymbol).join('\n')}
};
${buildFont(kerningResult, symbolResult)}
`);

View File

@ -103,7 +103,7 @@ language_translations = {
}
def get_supported_characters():
with open('assets/fonts/dejavu_sans_book_8.json', 'r') as f:
with open('assets/fonts/dejavu_sans/dejavu_sans_all.json', 'r') as f:
content = json.loads('\n'.join(f.readlines()))
result = {' ', '\t', '\n', '\r'}

View File

@ -0,0 +1,233 @@
// This tool takes a the json output from https://github.com/andryblack/fontbuilder
// and generates C code containing kerning and symbol information
// Usage:
// 1. Use fontbuilder to generate multiple font files
// - Settings used by game fonts: layout=optimized box, padding=1px right
// - Each image must be smaller than 4 KB
// - Name each JSON file <font>_0.json, <font>_1.json, ..., <font>_N.json
//
// 2. Also generate a single font with all characters on the same line
// - Name the JSON file <font>_all.json
// - This file is only needed to extract the kerning
//
// 3. Use this tool as follows:
// - node font_converter.js FontName /path/to/font_dir /path/to/output_dir
const fs = require('fs');
const path = require('path');
const INVALID_TOKEN_CHARACTER = /[^A-Za-z0-9_]/gim;
const MAX_HASH_MULTIPLIER = 0x10000;
function sanitize(s) {
return s.replace(INVALID_TOKEN_CHARACTER, '_');
}
function loadFont(fontDir) {
const dirName = path.basename(fontDir);
const fontFileRegex = new RegExp(String.raw`${dirName}_(\d)+\.json`);
const symbols = [];
// Find all font page JSON files and load their symbols
const fontPageFiles = [];
for (let file of fs.readdirSync(fontDir)) {
const match = file.match(fontFileRegex);
if (match) {
file = path.join(fontDir, file);
fontPageFiles.push(file);
const textureIndex = Number(match[1]);
const fontData = JSON.parse(fs.readFileSync(file));
symbols.push(
...fontData.symbols.map(s => ({
...s,
textureIndex
}))
)
}
}
// Load metadata and kerning from global file
const fontMasterFile = fontPageFiles.length === 1 ?
fontPageFiles[0] :
path.join(fontDir, `${dirName}_all.json`);
const { config, kerning } = JSON.parse(fs.readFileSync(fontMasterFile));
return { config, kerning, symbols };
}
function kerningHashFunction(kerning, multiplier, tableSize) {
return ((kerning.first * multiplier) + kerning.second) % tableSize;
}
function symbolHashFunction(symbol, multiplier, tableSize) {
return (symbol.id * multiplier) % tableSize;
}
function buildHashTable(list, hashFunction, multiplier, tableSize, emptyObj) {
const sparseArray = Array(tableSize);
let maxCollisions = 0;
let averageCollisions = 0;
for (const element of list) {
let currentCollisions = 0;
let index = hashFunction(element, multiplier, tableSize);
// Find the next available slot in the event of a collision
// The array is sized such that there will always be a slot eventually
while (sparseArray[index]) {
index = (index + 1) % tableSize;
++currentCollisions;
}
maxCollisions = Math.max(maxCollisions, currentCollisions);
averageCollisions += currentCollisions;
sparseArray[index] = element;
}
if (list.length > 0) {
averageCollisions /= list.length;
}
// Fill remaining slots
for (let i = 0; i < tableSize; ++i) {
if (!sparseArray[i]) {
sparseArray[i] = emptyObj;
}
}
return { sparseArray, maxCollisions, averageCollisions };
}
function searchForBestHashTable(list, hashFunction, emptyObj) {
let bestHashTable;
let multiplier;
// Pad table to next-next power of 2
// Reduces likelihood of collisions and allows easy wrapping with bitwise AND
const exponent = list.length ? Math.ceil(Math.log2(list.length)) : 0;
const tableSize = Math.pow(2, exponent + 1);
const mask = tableSize - 1;
for (let i = 1; i < MAX_HASH_MULTIPLIER; ++i) {
const hashTable = buildHashTable(list, hashFunction, i, tableSize, emptyObj);
if (!bestHashTable || hashTable.maxCollisions < bestHashTable.maxCollisions) {
bestHashTable = hashTable
multiplier = i;
}
}
return { ...bestHashTable, multiplier, mask };
}
// Kerning
function generateKerning(kerning) {
return ` {.amount = ${kerning.amount}, .first = ${kerning.first}, .second = ${kerning.second}},`;
}
function generateKerningTable(fontName, kerningList) {
return `struct FontKerning g${fontName}Kerning[] = {
${kerningList.map(generateKerning).join('\n')}
};`
}
// Symbols
function generateSymbol(symbol) {
return ` {
.id = ${symbol.id},
.x = ${symbol.x}, .y = ${symbol.y},
.width = ${symbol.width}, .height = ${symbol.height},
.xoffset = ${symbol.xoffset}, .yoffset = ${symbol.yoffset},
.xadvance = ${symbol.xadvance},
.textureIndex = ${symbol.textureIndex},
},`
}
function generateSymbolTable(fontName) {
return `struct FontSymbol g${fontName}Symbols[] = {
${symbolTable.sparseArray.map(generateSymbol).join('\n')}
};`
}
// Font
function generateFont(fontName, config, kerningTable, symbolTable) {
return `struct Font g${fontName}Font = {
.kerning = &g${fontName}Kerning[0],
.symbols = &g${fontName}Symbols[0],
.base = ${config.base},
.charHeight = ${config.charHeight},
.symbolMultiplier = ${symbolTable.multiplier},
.symbolMask = 0x${symbolTable.mask.toString(16)},
.symbolMaxCollisions = ${symbolTable.maxCollisions},
.kerningMultiplier = ${kerningTable.multiplier},
.kerningMask = 0x${kerningTable.mask.toString(16)},
.kerningMaxCollisions = ${kerningTable.maxCollisions},
};`
}
function generateSourceFile(fontName, config, kerningTable, symbolTable) {
fontName = sanitize(fontName);
return `#include "font/font.h"
${generateKerningTable(fontName, kerningTable.sparseArray)}
${generateSymbolTable(fontName, symbolTable.sparseArray)}
${generateFont(fontName, config, kerningTable, symbolTable)}`;
}
// Main
const [fontName, fontDir, outputFile] = process.argv.slice(2);
const outputDir = path.dirname(outputFile);
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}
const { config, kerning, symbols } = loadFont(fontDir);
const kerningTable = searchForBestHashTable(
kerning,
kerningHashFunction,
{
amount: 0,
first: 0,
second: 0
}
);
const symbolTable = searchForBestHashTable(
symbols,
symbolHashFunction,
{
id: 0,
x: 0, y: 0,
width: 0, height: 0,
xoffset: 0, yoffset: 0,
xadvance: 0,
textureIndex: -1
}
);
console.log(`symbolLength = ${symbols.length}/${symbolTable.sparseArray.length}`);
console.log(`symbolMaxCollisions = ${symbolTable.maxCollisions}`);
console.log(`symbolAverageCollisions = ${symbolTable.averageCollisions}`);
console.log(`kerningLength = ${kerning.length}/${kerningTable.sparseArray.length}`);
console.log(`maxKerningCollisions = ${kerningTable.maxCollisions}`);
console.log(`kerningAverageCollisions = ${kerningTable.averageCollisions}`);
fs.writeFileSync(
outputFile,
generateSourceFile(fontName, config, kerningTable, symbolTable)
);