font_kit/
family_name.rs

1// font-kit/src/descriptor.rs
2//
3// Copyright © 2018 The Pathfinder Project Developers.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11//! A possible value for the `font-family` CSS property.
12
13/// A possible value for the `font-family` CSS property.
14///
15/// These descriptions are taken from CSS Fonts Level 3 § 3.1:
16/// <https://drafts.csswg.org/css-fonts-3/#font-family-prop>.
17///
18/// TODO(pcwalton): `system-ui`, `emoji`, `math`, `fangsong`
19#[derive(Clone, Debug, PartialEq, Hash)]
20pub enum FamilyName {
21    /// A specific font family, specified by name: e.g. "Arial", "times".
22    Title(String),
23    /// Serif fonts represent the formal text style for a script.
24    Serif,
25    /// Glyphs in sans-serif fonts, as the term is used in CSS, are generally low contrast
26    /// (vertical and horizontal stems have the close to the same thickness) and have stroke
27    /// endings that are plain — without any flaring, cross stroke, or other ornamentation.
28    SansSerif,
29    /// The sole criterion of a monospace font is that all glyphs have the same fixed width.
30    Monospace,
31    /// Glyphs in cursive fonts generally use a more informal script style, and the result looks
32    /// more like handwritten pen or brush writing than printed letterwork.
33    Cursive,
34    /// Fantasy fonts are primarily decorative or expressive fonts that contain decorative or
35    /// expressive representations of characters.
36    Fantasy,
37}