mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-09 14:40:10 +01:00
36 lines
1.1 KiB
C
36 lines
1.1 KiB
C
#include "common/font.h"
|
|
#include "detection/displayserver/displayserver.h"
|
|
#include "detection/gtk_qt/gtk_qt.h"
|
|
#include "font.h"
|
|
|
|
void ffDetectFontImpl(const FFinstance* instance, FFFontResult* result)
|
|
{
|
|
const FFDisplayServerResult* wmde = ffConnectDisplayServer(instance);
|
|
|
|
if(ffStrbufIgnCaseCompS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY) == 0)
|
|
{
|
|
ffStrbufAppendS(&result->error, "Font isn't supported in TTY");
|
|
return;
|
|
}
|
|
|
|
FFfont qt;
|
|
ffFontInitQt(&qt, ffDetectQt(instance)->font.chars);
|
|
ffStrbufAppend(&result->fonts[0], &qt.pretty);
|
|
ffFontDestroy(&qt);
|
|
|
|
FFfont gtk2;
|
|
ffFontInitPango(>k2, ffDetectGTK2(instance)->font.chars);
|
|
ffStrbufAppend(&result->fonts[1], >k2.pretty);
|
|
ffFontDestroy(>k2);
|
|
|
|
FFfont gtk3;
|
|
ffFontInitPango(>k3, ffDetectGTK3(instance)->font.chars);
|
|
ffStrbufAppend(&result->fonts[2], >k3.pretty);
|
|
ffFontDestroy(>k3);
|
|
|
|
FFfont gtk4;
|
|
ffFontInitPango(>k4, ffDetectGTK4(instance)->font.chars);
|
|
ffStrbufAppend(&result->fonts[3], >k4.pretty);
|
|
ffFontDestroy(>k4);
|
|
}
|