pub fn aliases_from_family(
        manifest_family: &v2::Family,
    ) -> BTreeMap<UniCase<String>, FamilyOrAlias> {
        let mut output: BTreeMap<UniCase<String>, FamilyOrAlias> = BTreeMap::new();
        let family_name = UniCase::new(manifest_family.name.clone());
        let family_name_without_spaces = UniCase::new(manifest_family.name.replace(" ", ""));
        if family_name_without_spaces != family_name {
            output.insert(
                family_name_without_spaces,
                FamilyOrAlias::Alias(family_name.clone(), None),
            );
        }

        for alias_set in &manifest_family.aliases {
            let overrides = if alias_set.has_overrides() {
                Some(Arc::new(TypefaceQueryOverrides {
                    style: alias_set.style_overrides().clone(),
                    languages: alias_set.language_overrides().cloned().collect_vec(),
                }))
            } else {
                None
            };

            for alias_name in alias_set.names() {
                let alias_name = UniCase::new(alias_name.clone());
                output.insert(
                    alias_name.clone(),
                    FamilyOrAlias::Alias(family_name.clone(), overrides.clone()),
                );

                let alias_name_without_spaces = UniCase::new((*alias_name).replace(" ", ""));
                if alias_name != alias_name_without_spaces {
                    output.insert(
                        alias_name_without_spaces,
                        FamilyOrAlias::Alias(family_name.clone(), overrides.clone()),
                    );
                }
            }
        }

        output
    }
/// Generates a full set of aliases from a given manifest v2 `Family`, including alias variants
/// without spaces.
Generates a full set of aliases from a given manifest v2 `Family`, including alias variants
without spaces.
Generates a full set of aliases from a given manifest v2 ` Family ` including alias variants without spaces .
pub fn aliases_from_family(
        manifest_family: &v2::Family,
    ) -> BTreeMap<UniCase<String>, FamilyOrAlias> {
        let mut output: BTreeMap<UniCase<String>, FamilyOrAlias> = BTreeMap::new();
        let family_name = UniCase::new(manifest_family.name.clone());
        let family_name_without_spaces = UniCase::new(manifest_family.name.replace(" ", ""));
        if family_name_without_spaces != family_name {
            output.insert(
                family_name_without_spaces,
                FamilyOrAlias::Alias(family_name.clone(), None),
            );
        }
        for alias_set in &manifest_family.aliases {
            let overrides = if alias_set.has_overrides() {
                Some(Arc::new(TypefaceQueryOverrides {
                    style: alias_set.style_overrides().clone(),
                    languages: alias_set.language_overrides().cloned().collect_vec(),
                }))
            } else {
                None
            };
            for alias_name in alias_set.names() {
                let alias_name = UniCase::new(alias_name.clone());
                output.insert(
                    alias_name.clone(),
                    FamilyOrAlias::Alias(family_name.clone(), overrides.clone()),
                );
                let alias_name_without_spaces = UniCase::new((*alias_name).replace(" ", ""));
                if alias_name != alias_name_without_spaces {
                    output.insert(
                        alias_name_without_spaces,
                        FamilyOrAlias::Alias(family_name.clone(), overrides.clone()),
                    );
                }
            }
        }
        output
    }
pub fn aliases_from_family ( manifest_family : & v2 :: Family , ) -> BTreeMap < UniCase < String > , FamilyOrAlias > { let mut output : BTreeMap < UniCase < String > , FamilyOrAlias > = BTreeMap :: new ( ) ; let family_name = UniCase :: new ( manifest_family . name . clone ( ) ) ; let family_name_without_spaces = UniCase :: new ( manifest_family . name . replace ( " " , " " ) ) ; if family_name_without_spaces != family_name { output . insert ( family_name_without_spaces , FamilyOrAlias :: Alias ( family_name . clone ( ) , None ) , ) ; } for alias_set in & manifest_family . aliases { let overrides = if alias_set . has_overrides ( ) { Some ( Arc :: new ( TypefaceQueryOverrides { style : alias_set . style_overrides ( ) . clone ( ) , languages : alias_set . language_overrides ( ) . cloned ( ) . collect_vec ( ) , } ) ) } else { None } ; for alias_name in alias_set . names ( ) { let alias_name = UniCase :: new ( alias_name . clone ( ) ) ; output . insert ( alias_name . clone ( ) , FamilyOrAlias :: Alias ( family_name . clone ( ) , overrides . clone ( ) ) , ) ; let alias_name_without_spaces = UniCase :: new ( ( * alias_name ) . replace ( " " , " " ) ) ; if alias_name != alias_name_without_spaces { output . insert ( alias_name_without_spaces , FamilyOrAlias :: Alias ( family_name . clone ( ) , overrides . clone ( ) ) , ) ; } } } output }
Generates a full set of aliases from a given manifest v2 `Family`, including alias variants
without spaces.
Generates a full set of aliases from a given manifest v2 ` Family ` including alias variants without spaces .
manifest_family
&v2::Family