/// If the given `FT_SfntName` contains the requested `name_id` and the encoding is in a
/// supported format, returns the decoded name string. Otherwise, returns `None`.
///
/// Presently, this only looks at en-US name entries.
If the given `FT_SfntName` contains the requested `name_id` and the encoding is in a
supported format, returns the decoded name string. Otherwise, returns `None`.

Presently, this only looks at en-US name entries.
If the given ` FT_SfntName ` contains the requested ` name_id ` and the encoding is in a supported format returns the decoded name string . Otherwise returns ` None ` . Presently this only looks at en - US name entries .
fn decode_name_if_matches(
        name_entry: &FT_SfntName,
        name_id: u16,
    ) -> Result<Option<String>, Error> {
        if name_entry.name_id != name_id {
            return Ok(None);
        }
        match (name_entry.platform_id, name_entry.encoding_id, name_entry.language_id) {
            (TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, TT_MS_LANGID_ENGLISH_UNITED_STATES)
            | (TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, TT_MS_LANGID_ENGLISH_UNITED_STATES) => {
                let name = FTFace::decode_name_utf16_be(name_entry)?;
                Ok(Some(name))
            }
            _ => Ok(None),
        }
    }
fn decode_name_if_matches ( name_entry : & FT_SfntName , name_id : u16 , ) -> Result < Option < String > , Error > { if name_entry . name_id != name_id { return Ok ( None ) ; } match ( name_entry . platform_id , name_entry . encoding_id , name_entry . language_id ) { ( TT_PLATFORM_MICROSOFT , TT_MS_ID_SYMBOL_CS , TT_MS_LANGID_ENGLISH_UNITED_STATES ) | ( TT_PLATFORM_MICROSOFT , TT_MS_ID_UNICODE_CS , TT_MS_LANGID_ENGLISH_UNITED_STATES ) => { let name = FTFace :: decode_name_utf16_be ( name_entry ) ? ; Ok ( Some ( name ) ) } _ => Ok ( None ) , } }
If the given `FT_SfntName` contains the requested `name_id` and the encoding is in a
supported format, returns the decoded name string.
If the given ` FT_SfntName ` contains the requested ` name_id ` and the encoding is in a supported format returns the decoded name string .
name_entry
&FT_SfntName
name_id
u16