mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
LibWeb+LibWebView: Allow to specify default font size in FontPlugin
Instead of always assuming 12pt size for default font, explicitly pass it as a parameter.
This commit is contained in:
committed by
Andreas Kling
parent
1be55fe793
commit
0b8b690f92
@@ -43,14 +43,14 @@ void ImageBox::prepare_for_replaced_layout()
|
||||
set_natural_width(0);
|
||||
set_natural_height(0);
|
||||
} else {
|
||||
auto const& font = Platform::FontPlugin::the().default_font();
|
||||
auto font = Platform::FontPlugin::the().default_font(12);
|
||||
CSSPixels alt_text_width = 0;
|
||||
if (!m_cached_alt_text_width.has_value())
|
||||
m_cached_alt_text_width = CSSPixels::nearest_value_for(font.width(alt));
|
||||
m_cached_alt_text_width = CSSPixels::nearest_value_for(font->width(alt));
|
||||
alt_text_width = m_cached_alt_text_width.value();
|
||||
|
||||
set_natural_width(alt_text_width + 16);
|
||||
set_natural_height(CSSPixels::nearest_value_for(font.pixel_size()) + 16);
|
||||
set_natural_height(CSSPixels::nearest_value_for(font->pixel_size()) + 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user