Skip to main content

Module font

Module font 

Source
Expand description

Specified values for font properties

Re-exportsยง

pub use crate::values::computed::font::FontLanguageOverride;

Macrosยง

system_font_methods ๐Ÿ”’

Structsยง

FontPalette
Allows authors to choose a palette from those supported by a color font (and potentially @font-palette-values overrides).
FontVariantAlternates
List of Variant Alternates
FontVariantEastAsian
Variants for east asian variant
FontVariantLigatures
Variants of ligatures
FontVariantNumeric
Variants of numeric values
KeywordInfo
Additional information for keyword-derived font sizes.
MozScriptMinSize
Specifies the minimum font size allowed due to changes in scriptlevel. Ref: https://wiki.mozilla.org/MathML:mstyle
MozScriptSizeMultiplier
Specifies the multiplier to be used to adjust font size due to changes in scriptlevel.
QueryFontMetricsFlags
Flags for the query_font_metrics() function.
SystemFont
Dummy struct for system font, can never be constructed.
VariantAlternatesParsingFlags ๐Ÿ”’
Flags of variant alternates in bit
XLang
Internal property that reflects the lang attribute

Enumsยง

AbsoluteFontWeight
An absolute font-weight value for a @font-face rule.
FontFamily
Specifies a prioritized list of font family names or generic family names.
FontKerning
https://drafts.csswg.org/css-fonts/#propdef-font-kerning
FontOpticalSizing
https://www.w3.org/TR/css-fonts-4/#font-optical-sizing-def
FontSize
A specified font-size value
FontSizeAdjustFactor
A factor for one of the font-size-adjust metrics, which may be either a number or the from-font keyword.
FontSizeKeyword
CSS font keywords
FontSmoothing
Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)
FontStyle
The specified value of the font-style property.
FontSynthesis
A value for any of the font-synthesis-{weight,small-caps,position} properties.
FontSynthesisStyle
A value for the font-synthesis-style property.
FontVariantCaps
https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps
FontVariantEmoji
https://drafts.csswg.org/css-fonts/#propdef-font-variant-emoji
FontVariantPosition
https://drafts.csswg.org/css-fonts/#propdef-font-variant-position
FontWeight
A specified font-weight value.
FontWidth
A value for the font-width property.
FontWidthKeyword
A keyword value for font-width.
MathDepth
A value for the math-depth property. https://mathml-refresh.github.io/mathml-core/#the-math-script-level-property
MathShift
https://w3c.github.io/mathml-core/#the-math-shift
MathStyle
https://mathml-refresh.github.io/mathml-core/#the-math-style-property
MathVariant
Internal (not web-exposed). Presentation attribute for legacy mathml mathvariant.
MetricsOverride
A metrics override value for a @font-face descriptor
VariantAlternates
Set of variant alternates
XTextScale
How to do font-size scaling.

Constantsยง

DEFAULT_SCRIPT_MIN_SIZE_PT ๐Ÿ”’
DEFAULT_SCRIPT_SIZE_MULTIPLIER ๐Ÿ”’
FONT_MEDIUM_CAP_PX
The default cap height โ€“ https://drafts.csswg.org/css-values/#cap
FONT_MEDIUM_CH_PX
The default advance measure โ€“ https://drafts.csswg.org/css-values/#ch
FONT_MEDIUM_EX_PX
The default ex height โ€“ https://drafts.csswg.org/css-values/#ex
FONT_MEDIUM_IC_PX
The default idographic advance measure โ€“ https://drafts.csswg.org/css-values/#ic
FONT_MEDIUM_LINE_HEIGHT_PX
The default line height.
FONT_MEDIUM_PX
The default font size.
FONT_STYLE_OBLIQUE_MAX_ANGLE_DEGREES
From https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle:
FONT_STYLE_OBLIQUE_MIN_ANGLE_DEGREES
The minimum angle value that font-style: oblique should compute to.
LARGER_FONT_SIZE_RATIO ๐Ÿ”’
This is the ratio applied for font-size: larger and smaller by both Firefox and Chrome
MAX_FONT_WEIGHT
The maximum font-weight value per:
MIN_FONT_WEIGHT
The minimum font-weight value per:

Functionsยง

map_line_height_leaf ๐Ÿ”’
Maps a line-height calc leaf into a resolved leaf. Percentages are replaced with equivalent em lengths, and all lengths are resolved to absolute lengths.
parse_line_height_number ๐Ÿ”’
Parses a line height value. Percentages in -typed calc expressions are allowed in the line-height property, relative to the computed value of 1em. https://drafts.csswg.org/css-inline/#line-height-property
parse_one_feature_value ๐Ÿ”’
resolve_line_height_length ๐Ÿ”’
Resolves a line-height length into an absolute pixel value, properly applying text scaling and ensuring any lh lengths are resolved against the inherited line-height.

Type Aliasesยง

FontFeatureSettings
This property provides low-level control over OpenType or TrueType font features.
FontSizeAdjust
Specified value for font-size-adjust, intended to help preserve the readability of text when font fallback occurs.
FontVariationSettings
This property provides low-level control over OpenType or TrueType font variations.
LineHeight
A specified value for the line-height property.
SpecifiedFontStyle
The specified value of the font-style property, without the system font crap.