render: match Chrome font metrics with Liberation Sans/Serif/Mono
Chrome's default sans-serif on this class of host is Liberation Sans, not DejaVu (measured: sans-serif == Arial == Helvetica == Liberation width, DejaVu ~12% wider). Forcing DejaVu drifted all text wider and shifted every line. Bundle Liberation Sans/Serif/Mono (DejaVu kept as glyph fallback), default to Liberation Sans, and resolve font-family to the right generic (monospace/code -> Mono, serif -> Serif, else -> Sans). A controlled text page drops from ~15-20% to 3.5% pixel mismatch and every line lands within 1px of Chrome.
This commit is contained in:
1 parent
23594b1f96
commit
281a22e247
17 files changed
+90
-14
No files matched your search
@@ -239,6 +239,10 @@ pub struct LayoutStyle {
|
||||
/// root font-sizes. `None` when font-size was absolute or unset.
|
||||
pub font_size_raw: Option<Dimension>,
|
||||
pub font_weight: Option<String>,
|
||||
/// The computed `font-family` list, lowercased. Inherited. The text engine
|
||||
/// resolves it to a bundled face (Liberation Sans/Serif/Mono) the way
|
||||
/// Chromium picks a generic family on this host.
|
||||
pub font_family: Option<String>,
|
||||
pub align_items: Option<taffy::AlignItems>,
|
||||
pub flex_direction: Option<taffy::FlexDirection>,
|
||||
pub flex_wrap: Option<taffy::FlexWrap>,
|
||||
|
||||
Reference in new issue
Block a user