2025-05-20 21:55:15 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2025, blukai <init1@protonmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <AK/Assertions.h>
|
2026-06-04 05:40:32 -03:00
|
|
|
#include <AK/NeverDestroyed.h>
|
2025-05-20 21:55:15 -03:00
|
|
|
#include <LibGfx/Font/GlobalFontConfig.h>
|
|
|
|
|
#include <fontconfig/fontconfig.h>
|
|
|
|
|
|
|
|
|
|
namespace Gfx {
|
|
|
|
|
|
|
|
|
|
GlobalFontConfig::GlobalFontConfig()
|
|
|
|
|
{
|
|
|
|
|
FcBool inited = FcInit();
|
|
|
|
|
VERIFY(inited);
|
|
|
|
|
|
|
|
|
|
m_config = FcConfigGetCurrent();
|
|
|
|
|
FcConfigReference(m_config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalFontConfig::~GlobalFontConfig()
|
|
|
|
|
{
|
|
|
|
|
FcConfigDestroy(m_config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalFontConfig& GlobalFontConfig::the()
|
|
|
|
|
{
|
2026-06-04 05:40:32 -03:00
|
|
|
static NeverDestroyed<GlobalFontConfig> s_the;
|
|
|
|
|
return *s_the;
|
2025-05-20 21:55:15 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FcConfig* GlobalFontConfig::get()
|
|
|
|
|
{
|
|
|
|
|
return m_config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|