Skip to content

Commit

Permalink
LibWeb/Layout: Add FIXMEs where we're using the wrong font
Browse files Browse the repository at this point in the history
It's not clear how to address these right now, so add a FIXME to make
them easier to find and address later.
  • Loading branch information
AtkinsSJ authored and kalenikaliaksandr committed Dec 6, 2024
1 parent 00302b5 commit ebc9168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/LibWeb/Layout/BlockFormattingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ void BlockFormattingContext::ensure_sizes_correct_for_left_offset_calculation(Li
if (marker_text.is_empty()) {
marker_state.set_content_width(image_width + default_marker_width);
} else {
// FIXME: Use per-code-point fonts to measure text.
auto text_width = marker.first_available_font().width(marker_text);
marker_state.set_content_width(image_width + CSSPixels::nearest_value_for(text_width));
}
Expand Down
2 changes: 2 additions & 0 deletions Libraries/LibWeb/Layout/SVGFormattingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ void SVGFormattingContext::layout_nested_viewport(Box const& viewport)
Gfx::Path SVGFormattingContext::compute_path_for_text(SVGTextBox const& text_box)
{
auto& text_element = static_cast<SVG::SVGTextPositioningElement const&>(text_box.dom_node());
// FIXME: Use per-code-point fonts.
auto& font = text_box.first_available_font();
auto text_contents = text_element.text_contents();
Utf8View text_utf8 { text_contents };
Expand Down Expand Up @@ -349,6 +350,7 @@ Gfx::Path SVGFormattingContext::compute_path_for_text_path(SVGTextPathBox const&
if (!path_or_shape)
return {};

// FIXME: Use per-code-point fonts.
auto& font = text_path_box.first_available_font();
auto text_contents = text_path_element.text_contents();
Utf8View text_utf8 { text_contents };
Expand Down

0 comments on commit ebc9168

Please sign in to comment.