unsafe fn find_sfd_file(sfd_name: &str) -> i32 {
    let mut id: i32 = -1;
    /* Check if we already opened SFD file */
    for (i, sfd) in sfd_files.iter().enumerate() {
        if sfd.ident == sfd_name {
            id = i as i32;
            break;
        }
    }
    if id < 0 {
        let mut sfd = sfd_file_::new();
        sfd.ident = sfd_name.to_string();
        if let Some(mut handle) = InFile::open(&sfd.ident, TTInputFormat::SFD, 0) {
            let error = scan_sfd_file(&mut sfd, &mut handle);
            if error == 0 {
                id = sfd_files.len() as i32;
                sfd_files.push(sfd);
            } else {
                warn!("Error occured while reading SFD file \"{}\"", sfd_name);
                id = -1
            }
        } else {
            return -1;
        }
    }
    id
}
/* Open SFD file and gather subfont IDs. We do not read mapping tables
 * here but only read subfont IDs used in SFD file.
 */
Open SFD file and gather subfont IDs. We do not read mapping tables
here but only read subfont IDs used in SFD file.
Open SFD file and gather subfont IDs . We do not read mapping tables here but only read subfont IDs used in SFD file .
unsafe fn find_sfd_file(sfd_name: &str) -> i32 {
    let mut id: i32 = -1;
    /* Check if we already opened SFD file */
    for (i, sfd) in sfd_files.iter().enumerate() {
        if sfd.ident == sfd_name {
            id = i as i32;
            break;
        }
    }
    if id < 0 {
        let mut sfd = sfd_file_::new();
        sfd.ident = sfd_name.to_string();
        if let Some(mut handle) = InFile::open(&sfd.ident, TTInputFormat::SFD, 0) {
            let error = scan_sfd_file(&mut sfd, &mut handle);
            if error == 0 {
                id = sfd_files.len() as i32;
                sfd_files.push(sfd);
            } else {
                warn!("Error occured while reading SFD file \"{}\"", sfd_name);
                id = -1
            }
        } else {
            return -1;
        }
    }
    id
}
unsafe fn find_sfd_file ( sfd_name : & str ) -> i32 { let mut id : i32 = - 1 ; /* Check if we already opened SFD file */ for ( i , sfd ) in sfd_files . iter ( ) . enumerate ( ) { if sfd . ident == sfd_name { id = i as i32 ; break ; } } if id < 0 { let mut sfd = sfd_file_ :: new ( ) ; sfd . ident = sfd_name . to_string ( ) ; if let Some ( mut handle ) = InFile :: open ( & sfd . ident , TTInputFormat :: SFD , 0 ) { let error = scan_sfd_file ( & mut sfd , & mut handle ) ; if error == 0 { id = sfd_files . len ( ) as i32 ; sfd_files . push ( sfd ) ; } else { warn ! ( " \" \" " sfd_name ) ; id = - 1 } } else { return - 1 ; } } id }
Open SFD file and gather subfont IDs.
Open SFD file and gather subfont IDs .
sfd_name
&str