mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Separate font computation logic from StyleComputer
Font computation and loading is distinct enough from style computation that it makes more sense to have this in it's own class. This will be useful later when we move the font loading process to `ComputedProperties` in order to respect animated values.
This commit is contained in:
parent
dfa47d9ed6
commit
6c236d04d8
Notes:
github-actions[bot]
2025-12-05 10:04:34 +00:00
Author: https://github.com/Calme1709
Commit: 6c236d04d8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6757
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
13 changed files with 722 additions and 646 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "CanvasTextDrawingStyles.h"
|
||||
#include <LibWeb/CSS/ComputedProperties.h>
|
||||
#include <LibWeb/CSS/FontComputer.h>
|
||||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/CSS/StyleValues/FontStyleStyleValue.h>
|
||||
|
|
@ -142,7 +143,7 @@ void CanvasTextDrawingStyles<IncludingClass, CanvasType>::set_font(StringView fo
|
|||
auto const& computed_font_width = CSS::StyleComputer::compute_font_width(font_width, computation_context);
|
||||
auto const& computed_font_style = CSS::StyleComputer::compute_font_style(font_style, computation_context);
|
||||
|
||||
return document->style_computer().compute_font_for_style_values(
|
||||
return document->font_computer().compute_font_for_style_values(
|
||||
font_family,
|
||||
computed_font_size->as_length().length().absolute_length_to_px(),
|
||||
computed_font_style->as_font_style().to_font_slope(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue