Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/Font/Font.h>
#include <LibGfx/Font/FontDatabase.h>
#include <harfbuzz/hb.h>
namespace Gfx {
Font::~Font()
{
if (m_harfbuzz_font)
hb_font_destroy(m_harfbuzz_font);
}
Font const& Font::bold_variant() const
{
if (m_bold_variant)
return *m_bold_variant;
m_bold_variant = Gfx::FontDatabase::the().get(family(), point_size(), 700, Gfx::FontWidth::Normal, 0);
if (!m_bold_variant)
m_bold_variant = this;
return *m_bold_variant;
}
hb_font_t* Font::harfbuzz_font() const
{
if (!m_harfbuzz_font) {
m_harfbuzz_font = hb_font_create(typeface().harfbuzz_typeface());
hb_font_set_scale(m_harfbuzz_font, pixel_size() * text_shaping_resolution, pixel_size() * text_shaping_resolution);
hb_font_set_ptem(m_harfbuzz_font, point_size());
}
return m_harfbuzz_font;
}
}