mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00

This change should move us forward toward emoji support, as we are no longer limited by our own OpenType implementation, which was failing to parse the TrueType Collection format used to store emoji fonts (at least on macOS).
21 lines
476 B
C++
21 lines
476 B
C++
/*
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/TypeCasts.h>
|
|
#include <LibGfx/Font/ScaledFont.h>
|
|
#include <LibGfx/Font/TypefaceSkia.h>
|
|
|
|
#include <core/SkFont.h>
|
|
|
|
namespace Gfx {
|
|
|
|
SkFont ScaledFont::skia_font(float scale) const
|
|
{
|
|
auto const& sk_typeface = verify_cast<TypefaceSkia>(*m_typeface).sk_typeface();
|
|
return SkFont { sk_ref_sp(sk_typeface), pixel_size() * scale };
|
|
}
|
|
|
|
}
|