Refactor: move font functions to own header

This commit is contained in:
Linus Dierheimer
2022-07-25 13:44:55 +02:00
parent cea48474a1
commit 5c73125693
5 changed files with 26 additions and 15 deletions
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/font.h"
#include <string.h>
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#ifndef FF_INCLUDED_common_font
#define FF_INCLUDED_common_font
#include "util/FFstrbuf.h"
#include "util/FFlist.h"
typedef struct FFfont
{
FFstrbuf pretty;
FFstrbuf name;
FFstrbuf size;
FFlist styles;
} FFfont;
void ffFontInitQt(FFfont* font, const char* data);
void ffFontInitPango(FFfont* font, const char* data);
void ffFontInitCopy(FFfont* font, const char* name);
void ffFontInitValues(FFfont* font, const char* name, const char* size);
void ffFontDestroy(FFfont* font);
#endif
-15
View File
@@ -357,14 +357,6 @@ typedef union FFvariant
#define FF_VARIANT_NULL ((FFvariant){.strValue = NULL})
typedef struct FFfont
{
FFstrbuf pretty;
FFstrbuf name;
FFstrbuf size;
FFlist styles;
} FFfont;
//////////////////////
// Common functions //
//////////////////////
@@ -379,13 +371,6 @@ void ffListFeatures();
//common/threading.c
void ffStartDetectionThreads(FFinstance* instance);
//common/font.c
void ffFontInitQt(FFfont* font, const char* data);
void ffFontInitPango(FFfont* font, const char* data);
void ffFontInitCopy(FFfont* font, const char* name);
void ffFontInitValues(FFfont* font, const char* name, const char* size);
void ffFontDestroy(FFfont* font);
//common/format.c
void ffFormatAppendFormatArg(FFstrbuf* buffer, const FFformatarg* formatarg);
void ffParseFormatString(FFstrbuf* buffer, const FFstrbuf* formatstr, uint32_t numArgs, const FFformatarg* arguments);
+1
View File
@@ -1,4 +1,5 @@
#include "fastfetch.h"
#include "common/font.h"
#include "common/printing.h"
#define FF_FONT_MODULE_NAME "Font"
+1
View File
@@ -1,6 +1,7 @@
#include "fastfetch.h"
#include "common/properties.h"
#include "common/printing.h"
#include "common/font.h"
#define FF_TERMFONT_MODULE_NAME "Terminal Font"
#define FF_TERMFONT_NUM_FORMAT_ARGS 5