mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibWeb/CSS: Implement the font-kerning
property
This sets whether the kerning information stored on the current font is used.
This commit is contained in:
parent
80ea865b19
commit
9b6da84fff
Notes:
github-actions[bot]
2025-06-23 12:28:02 +00:00
Author: https://github.com/tcl3
Commit: 9b6da84fff
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5168
Reviewed-by: https://github.com/AtkinsSJ ✅
17 changed files with 108 additions and 20 deletions
|
@ -417,6 +417,20 @@ HashMap<StringView, u8> InlineLevelIterator::shape_features_map() const
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: vkrn should be enabled for vertical text.
|
||||
switch (computed_values.font_kerning()) {
|
||||
case CSS::FontKerning::Auto:
|
||||
// FIXME: Use a heuristic to determine whether to enable kerning.
|
||||
case CSS::FontKerning::Normal:
|
||||
features.set("kern"sv, 1);
|
||||
break;
|
||||
case CSS::FontKerning::None:
|
||||
features.set("kern"sv, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
|
|
|
@ -387,6 +387,7 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
|
|||
computed_values.set_font_list(computed_style.computed_font_list());
|
||||
computed_values.set_font_size(computed_style.property(CSS::PropertyID::FontSize).as_length().length().to_px(*this));
|
||||
computed_values.set_font_weight(round_to<int>(computed_style.property(CSS::PropertyID::FontWeight).as_number().number()));
|
||||
computed_values.set_font_kerning(computed_style.font_kerning());
|
||||
computed_values.set_line_height(computed_style.line_height());
|
||||
|
||||
computed_values.set_vertical_align(computed_style.vertical_align());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue