aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-02-04 22:34:14 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-02-04 22:34:14 +0100
commit1cc8fee44c0a935911660db7da71595f91d8dd24 (patch)
treec196890f34d42c4187147fc62357a04b36a34ab7
parenta03f0d19e99ed575d0caacb6d3e41d809bfa91a1 (diff)
downloadd2tk-1cc8fee44c0a935911660db7da71595f91d8dd24.tar.xz
meson: check for fonts using system fonts.
-rw-r--r--VERSION2
-rwxr-xr-xcheck_for_font3
-rw-r--r--meson.build38
-rw-r--r--src/base.c2
-rw-r--r--src/base_pty.c8
-rw-r--r--src/core.c2
-rw-r--r--ttf/FiraCode-Bold.ttf (renamed from ttf/FiraCode: bold.ttf)bin315784 -> 315784 bytes
-rw-r--r--ttf/FiraCode-Light.ttf (renamed from ttf/FiraCode: light.ttf)bin276684 -> 276684 bytes
-rw-r--r--ttf/FiraCode-Medium.ttf (renamed from ttf/FiraCode: medium.ttf)bin286232 -> 286232 bytes
-rw-r--r--ttf/FiraCode-Regular.ttf (renamed from ttf/FiraCode: regular.ttf)bin290360 -> 290360 bytes
-rw-r--r--ttf/FiraSans-Bold.ttf (renamed from ttf/FiraSans: bold.ttf)bin521312 -> 521312 bytes
11 files changed, 38 insertions, 17 deletions
diff --git a/VERSION b/VERSION
index d1f5dfb..77ace3a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.993
+0.1.995
diff --git a/check_for_font b/check_for_font
new file mode 100755
index 0000000..befcbf4
--- /dev/null
+++ b/check_for_font
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+fc-list | grep "$1"
diff --git a/meson.build b/meson.build
index 755d80f..8a4546c 100644
--- a/meson.build
+++ b/meson.build
@@ -20,6 +20,16 @@ use_vterm = get_option('use-vterm')
use_evdev = get_option('use-evdev')
use_fontconfig = get_option('use-fontconfig')
+grep = find_program('grep',
+ native : true,
+ required : use_fontconfig)
+fc_list = find_program('fc-list',
+ native : true,
+ required : use_fontconfig)
+check_for_font = find_program('check_for_font',
+ native : true,
+ required : use_fontconfig)
+
prefix = get_option('prefix')
datadir = get_option('datadir')
bindir = get_option('bindir')
@@ -301,32 +311,32 @@ config_h = configure_file(
if not use_fontconfig.enabled()
fira_sans_bold_ttf = configure_file(
- input : join_paths('ttf', 'FiraSans: bold.ttf'),
- output : 'FiraSans-Bold.ttf',
+ input : join_paths('ttf', 'FiraSans-Bold.ttf'),
+ output : 'FiraSans:bold.ttf',
copy : true,
install : false)
fira_code_bold_ttf = configure_file(
- input : join_paths('ttf', 'FiraCode: bold.ttf'),
- output : 'FiraCode-Bold.ttf',
+ input : join_paths('ttf', 'FiraCode-Bold.ttf'),
+ output : 'FiraCode:bold.ttf',
copy : true,
install : false)
fira_code_light_ttf = configure_file(
- input : join_paths('ttf', 'FiraCode: light.ttf'),
- output : 'FiraCode-Light.ttf',
+ input : join_paths('ttf', 'FiraCode-Light.ttf'),
+ output : 'FiraCode:light.ttf',
copy : true,
install : false)
fira_code_medium_ttf = configure_file(
- input : join_paths('ttf', 'FiraCode: medium.ttf'),
- output : 'FiraCode-Medium.ttf',
+ input : join_paths('ttf', 'FiraCode-Medium.ttf'),
+ output : 'FiraCode:medium.ttf',
copy : true,
install : false)
fira_code_regular_ttf = configure_file(
- input : join_paths('ttf', 'FiraCode: regular.ttf'),
- output : 'FiraCode-Regular.ttf',
+ input : join_paths('ttf', 'FiraCode-Regular.ttf'),
+ output : 'FiraCode:regular.ttf',
copy : true,
install : false)
endif
@@ -366,4 +376,12 @@ if build_tests
test('Test core', test_core)
test('Test base', test_base)
+
+ if fc_list.found() and grep.found() and check_for_font.found()
+ test('FiraSans-Bold.ttf', check_for_font, args : ['FiraSans-Bold.ttf'])
+ test('FiraCode-Light.ttf', check_for_font, args : ['FiraCode-Light.tt'])
+ test('FiraCode-Regular.ttf', check_for_font, args : ['FiraCode-Regular.ttf'])
+ test('FiraCode-Medium.ttf', check_for_font, args : ['FiraCode-Medium.ttf'])
+ test('FiraCode-Bold.ttf', check_for_font, args : ['FiraCode-Bold.ttf'])
+ endif
endif
diff --git a/src/base.c b/src/base.c
index 33bb943..c12e9be 100644
--- a/src/base.c
+++ b/src/base.c
@@ -658,7 +658,7 @@ d2tk_base_is_active_hot(d2tk_base_t *base, d2tk_id_t id,
#define light_orange 0xffcf00ff
#define dark_orange 0xcf9f00ff
-#define FONT_SANS_BOLD "FiraSans: bold"
+#define FONT_SANS_BOLD "FiraSans:bold"
D2TK_API const d2tk_style_t *
d2tk_base_get_default_style()
diff --git a/src/base_pty.c b/src/base_pty.c
index 818c438..111fa17 100644
--- a/src/base_pty.c
+++ b/src/base_pty.c
@@ -38,10 +38,10 @@
#define MAX(x, y) (x > y ? y : x)
-#define FONT_CODE_LIGHT "FiraCode: light"
-#define FONT_CODE_REGULAR "FiraCode: regular"
-#define FONT_CODE_MEDIUM "FiraCode: medium"
-#define FONT_CODE_BOLD "FiraCode: bold"
+#define FONT_CODE_LIGHT "FiraCode:light"
+#define FONT_CODE_REGULAR "FiraCode:regular"
+#define FONT_CODE_MEDIUM "FiraCode:medium"
+#define FONT_CODE_BOLD "FiraCode:bold"
typedef struct _cell_t cell_t;
typedef struct _d2tk_atom_body_pty_t d2tk_atom_body_pty_t;
diff --git a/src/core.c b/src/core.c
index c4672c9..b4781ef 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1662,7 +1662,6 @@ d2tk_core_get_font_path(d2tk_core_t *core, const char *bundle_path,
FcChar8 *file = NULL;
if(FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch)
{
- fprintf(stderr, "[%s] '%s' '%s'\n", __func__, rel_path, file);
snprintf(abs_path, abs_len, "%s", file);
ret = 0;
}
@@ -1674,6 +1673,7 @@ d2tk_core_get_font_path(d2tk_core_t *core, const char *bundle_path,
FcConfigDestroy(config);
#else
+ (void)core;
snprintf(abs_path, abs_len, "%s%s.ttf", bundle_path, rel_path);
ret = 0;
#endif
diff --git a/ttf/FiraCode: bold.ttf b/ttf/FiraCode-Bold.ttf
index 5030383..5030383 100644
--- a/ttf/FiraCode: bold.ttf
+++ b/ttf/FiraCode-Bold.ttf
Binary files differ
diff --git a/ttf/FiraCode: light.ttf b/ttf/FiraCode-Light.ttf
index 95913af..95913af 100644
--- a/ttf/FiraCode: light.ttf
+++ b/ttf/FiraCode-Light.ttf
Binary files differ
diff --git a/ttf/FiraCode: medium.ttf b/ttf/FiraCode-Medium.ttf
index eca9e18..eca9e18 100644
--- a/ttf/FiraCode: medium.ttf
+++ b/ttf/FiraCode-Medium.ttf
Binary files differ
diff --git a/ttf/FiraCode: regular.ttf b/ttf/FiraCode-Regular.ttf
index 97c1159..97c1159 100644
--- a/ttf/FiraCode: regular.ttf
+++ b/ttf/FiraCode-Regular.ttf
Binary files differ
diff --git a/ttf/FiraSans: bold.ttf b/ttf/FiraSans-Bold.ttf
index f03425a..f03425a 100644
--- a/ttf/FiraSans: bold.ttf
+++ b/ttf/FiraSans-Bold.ttf
Binary files differ