LibGfx+WebContent: Remove unused Font::variant() and Typeface::variant()
This commit is contained in:
parent
b4652e4895
commit
8cd6682e6f
Notes:
github-actions[bot]
2024-09-05 17:23:12 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/8cd6682e6f1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1278 Reviewed-by: https://github.com/trflynn89
8 changed files with 0 additions and 29 deletions
|
@ -87,7 +87,6 @@ public:
|
|||
virtual float width(Utf8View const&) const = 0;
|
||||
|
||||
virtual String family() const = 0;
|
||||
virtual String variant() const = 0;
|
||||
|
||||
virtual NonnullRefPtr<Font> with_size(float point_size) const = 0;
|
||||
|
||||
|
|
|
@ -93,18 +93,6 @@ RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, float point_size, u
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Font> FontDatabase::get(FlyString const& family, FlyString const& variant, float point_size)
|
||||
{
|
||||
auto it = m_private->typeface_by_family.find(family);
|
||||
if (it == m_private->typeface_by_family.end())
|
||||
return nullptr;
|
||||
for (auto const& typeface : it->value) {
|
||||
if (typeface->variant() == variant)
|
||||
return typeface->scaled_font(point_size);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void FontDatabase::for_each_typeface_with_family_name(FlyString const& family_name, Function<void(Typeface const&)> callback)
|
||||
{
|
||||
auto it = m_private->typeface_by_family.find(family_name);
|
||||
|
|
|
@ -22,7 +22,6 @@ public:
|
|||
static FontDatabase& the();
|
||||
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned width, unsigned slope);
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size);
|
||||
|
||||
void for_each_typeface_with_family_name(FlyString const& family_name, Function<void(Typeface const&)>);
|
||||
|
||||
|
|
|
@ -403,17 +403,6 @@ String Typeface::family() const
|
|||
return *m_family;
|
||||
}
|
||||
|
||||
String Typeface::variant() const
|
||||
{
|
||||
if (!m_name.has_value())
|
||||
return {};
|
||||
|
||||
auto string = m_name->typographic_subfamily_name();
|
||||
if (!string.is_empty())
|
||||
return string;
|
||||
return m_name->subfamily_name();
|
||||
}
|
||||
|
||||
u16 Typeface::weight() const
|
||||
{
|
||||
if (!m_weight.has_value()) {
|
||||
|
|
|
@ -60,7 +60,6 @@ public:
|
|||
virtual u16 units_per_em() const override;
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const override;
|
||||
virtual String family() const override;
|
||||
virtual String variant() const override;
|
||||
virtual u16 weight() const override;
|
||||
virtual u16 width() const override;
|
||||
virtual u8 slope() const override;
|
||||
|
|
|
@ -38,7 +38,6 @@ public:
|
|||
virtual float width(StringView) const override;
|
||||
virtual float width(Utf8View const&) const override;
|
||||
virtual String family() const override { return m_typeface->family(); }
|
||||
virtual String variant() const override { return m_typeface->variant(); }
|
||||
|
||||
virtual NonnullRefPtr<ScaledFont> scaled_with_size(float point_size) const;
|
||||
virtual NonnullRefPtr<Font> with_size(float point_size) const override;
|
||||
|
|
|
@ -53,7 +53,6 @@ public:
|
|||
virtual u16 units_per_em() const = 0;
|
||||
virtual u32 glyph_id_for_code_point(u32 code_point) const = 0;
|
||||
virtual String family() const = 0;
|
||||
virtual String variant() const = 0;
|
||||
virtual u16 weight() const = 0;
|
||||
virtual u16 width() const = 0;
|
||||
virtual u8 slope() const = 0;
|
||||
|
|
|
@ -567,7 +567,6 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, i32 node_id, Optional<W
|
|||
MUST(font_json_object.add("name"sv, font->family()));
|
||||
MUST(font_json_object.add("size"sv, font->point_size()));
|
||||
MUST(font_json_object.add("weight"sv, font->weight()));
|
||||
MUST(font_json_object.add("variant"sv, font->variant()));
|
||||
MUST(font_json_object.finish());
|
||||
});
|
||||
MUST(serializer.finish());
|
||||
|
|
Loading…
Add table
Reference in a new issue