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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Definitions for specifying variations and typographic features.
use Tag;
use FromStr;
/// Setting defined by a selector tag and an associated value.
///
/// This type is a generic container for properties that can be activated
/// or defined by a `(Tag, T)` pair where the tag selects the target
/// setting and the generic value of type `T` specifies the value for that
/// setting.
///
/// ## Usage
/// Current usage is for specifying variation axis settings (similar to the
/// CSS property [font-variation-settings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variation-settings)).
/// See [`VariationSetting`].
///
/// In the future, this will likely also be used for specifying feature settings
/// (analogous to the CSS property [font-feature-settings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings))
/// for selecting OpenType [features](https://learn.microsoft.com/en-us/typography/opentype/spec/featuretags).
// This is provided so that &[VariationSetting] can be passed to the
// variation_settings() method of ScalerBuilder.
/// Type for specifying a variation axis setting in user coordinates.
///
/// The `selector` field should contain a tag that corresponds to a
/// variation axis while the `value` field specifies the desired position
/// on the axis in user coordinates (i.e. within the range defined by
/// the minimum and maximum values of the axis).
///
/// # Example
/// ```
/// use fontcull_skrifa::{Tag, setting::VariationSetting};
///
/// // For convenience, a conversion from (&str, f32) is provided.
/// let slightly_bolder: VariationSetting = ("wght", 720.0).into();
///
/// assert_eq!(slightly_bolder, VariationSetting::new(Tag::new(b"wght"), 720.0));
/// ```
pub type VariationSetting = ;