pub const DEFAULT_FONT_SIZE: f32 = 16.0;Expand description
Default/fallback font size in pixels, used when no font-size is specified.
This is the same as the CSS “medium” keyword and matches browser defaults:
- CSS 2.1 §15.7: “medium” is the user’s preferred font size
- All major browsers default to 16px
- W3C HTML5: The default font-size of the root element is 16px
This constant is used in two scenarios:
- As fallback when no explicit font-size is found in the cascade
- In legacy
to_pixels()for em/rem conversion when no context available
Research:
- Chrome/Firefox/Safari: 16px default
- CSS font-size keywords: medium = 16px (derived from 13.33px * 1.2)
- Can be overridden by user preferences (browser settings)