Skip to content

Commit 4f28ae6

Browse files
committed
Font: don't depend on displayserver detection on Windows and macOS.
1 parent e953ea6 commit 4f28ae6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/detection/font/font_linux.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#include "common/font.h"
2+
#include "detection/displayserver/displayserver.h"
23
#include "detection/gtk_qt/gtk_qt.h"
34
#include "font.h"
45

56
void ffDetectFontImpl(const FFinstance* instance, FFFontResult* result)
67
{
8+
const FFDisplayServerResult* wmde = ffConnectDisplayServer(instance);
9+
10+
if(ffStrbufIgnCaseCompS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY) == 0)
11+
{
12+
ffStrbufAppendS(&result->error, "Font isn't supported in TTY");
13+
return;
14+
}
15+
716
FFfont qt;
817
ffFontInitQt(&qt, ffDetectQt(instance)->font.chars);
918
ffStrbufAppend(&result->fonts[0], &qt.pretty);

src/modules/font.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ void ffPrintFont(FFinstance* instance)
7575
{
7676
assert(FF_DETECT_FONT_NUM_FONTS == FF_FONT_NUM_FORMAT_ARGS);
7777

78-
const FFDisplayServerResult* wmde = ffConnectDisplayServer(instance);
79-
80-
if(ffStrbufIgnCaseCompS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY) == 0)
81-
{
82-
ffPrintError(instance, FF_FONT_MODULE_NAME, 0, &instance->config.font, "Font isn't supported in TTY");
83-
return;
84-
}
85-
8678
const FFFontResult* font = ffDetectFont(instance);
8779

8880
if(font->error.length > 0)

0 commit comments

Comments
 (0)