mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
39 lines
626 B
C++
39 lines
626 B
C++
|
|
/*
|
||
|
|
* Copyright (c) 2025, blukai <init1@protonmail.com>
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <AK/Assertions.h>
|
||
|
|
#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()
|
||
|
|
{
|
||
|
|
static GlobalFontConfig s_the;
|
||
|
|
return s_the;
|
||
|
|
}
|
||
|
|
|
||
|
|
FcConfig* GlobalFontConfig::get()
|
||
|
|
{
|
||
|
|
return m_config;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|