mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGfx: Join SkiaFont.cpp into Font
No need to keep this function in a separate file.
This commit is contained in:
parent
8e2d1559ec
commit
455700d379
Notes:
github-actions[bot]
2025-04-21 07:52:36 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 455700d379
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4409
3 changed files with 8 additions and 24 deletions
|
@ -13,7 +13,6 @@ set(SOURCES
|
|||
Font/Font.cpp
|
||||
Font/FontData.cpp
|
||||
Font/FontDatabase.cpp
|
||||
Font/FontSkia.cpp
|
||||
Font/PathFontProvider.cpp
|
||||
Font/Typeface.cpp
|
||||
Font/TypefaceSkia.cpp
|
||||
|
|
|
@ -129,4 +129,12 @@ hb_font_t* Font::harfbuzz_font() const
|
|||
return m_harfbuzz_font;
|
||||
}
|
||||
|
||||
SkFont Font::skia_font(float scale) const
|
||||
{
|
||||
auto const& sk_typeface = as<TypefaceSkia>(*m_typeface).sk_typeface();
|
||||
auto sk_font = SkFont { sk_ref_sp(sk_typeface), pixel_size() * scale };
|
||||
sk_font.setSubpixel(true);
|
||||
return sk_font;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Font/TypefaceSkia.h>
|
||||
|
||||
#include <core/SkFont.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
SkFont Font::skia_font(float scale) const
|
||||
{
|
||||
auto const& sk_typeface = as<TypefaceSkia>(*m_typeface).sk_typeface();
|
||||
auto sk_font = SkFont { sk_ref_sp(sk_typeface), pixel_size() * scale };
|
||||
sk_font.setSubpixel(true);
|
||||
return sk_font;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue