nits
This commit is contained in:
parent
dc03df8986
commit
03180dd9ee
1 changed files with 0 additions and 5 deletions
|
|
@ -157,27 +157,22 @@ impl FeatureTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Font feature with tag and value
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||||
pub struct Feature {
|
pub struct Feature {
|
||||||
pub tag: FeatureTag,
|
pub tag: FeatureTag,
|
||||||
pub value: u32,
|
pub value: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Font features for text shaping
|
|
||||||
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
|
#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)]
|
||||||
pub struct FontFeatures {
|
pub struct FontFeatures {
|
||||||
/// List of OpenType features with their values (0 = disabled, 1 = enabled)
|
|
||||||
pub features: Vec<Feature>,
|
pub features: Vec<Feature>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FontFeatures {
|
impl FontFeatures {
|
||||||
/// Create new font features with default settings
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self { features: Vec::new() }
|
Self { features: Vec::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set a feature value
|
|
||||||
pub fn set(&mut self, tag: FeatureTag, value: u32) -> &mut Self {
|
pub fn set(&mut self, tag: FeatureTag, value: u32) -> &mut Self {
|
||||||
self.features.push(Feature { tag, value });
|
self.features.push(Feature { tag, value });
|
||||||
self
|
self
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue