1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// font-kit/src/descriptor.rs
//
// Copyright © 2018 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! A possible value for the `font-family` CSS property.

/// A possible value for the `font-family` CSS property.
///
/// These descriptions are taken from CSS Fonts Level 3 § 3.1:
/// https://drafts.csswg.org/css-fonts-3/#font-family-prop.
///
/// TODO(pcwalton): `system-ui`, `emoji`, `math`, `fangsong`
#[derive(Clone, Debug, PartialEq)]
pub enum FamilyName {
    /// A specific font family, specified by name: e.g. "Arial", "times".
    Title(String),
    /// Serif fonts represent the formal text style for a script.
    Serif,
    /// Glyphs in sans-serif fonts, as the term is used in CSS, are generally low contrast
    /// (vertical and horizontal stems have the close to the same thickness) and have stroke
    /// endings that are plain — without any flaring, cross stroke, or other ornamentation.
    SansSerif,
    /// The sole criterion of a monospace font is that all glyphs have the same fixed width.
    Monospace,
    /// Glyphs in cursive fonts generally use a more informal script style, and the result looks
    /// more like handwritten pen or brush writing than printed letterwork.
    Cursive,
    /// Fantasy fonts are primarily decorative or expressive fonts that contain decorative or
    /// expressive representations of characters.
    Fantasy,
}