pub fn to_font(&self, size: f64, load_fallbacks: bool) -> Font {
        let ct_font = ct_new_from_descriptor(&self.ct_descriptor, size);
        let cg_font = ct_font.copy_to_CGFont();

        let fallbacks = if load_fallbacks {
            // TODO fixme, hardcoded en for english.
            let mut fallbacks = cascade_list_for_languages(&ct_font, &["en".to_owned()])
                .into_iter()
                .filter(|desc| !desc.font_path.as_os_str().is_empty())
                .map(|desc| desc.to_font(size, false))
                .collect::<Vec<_>>();

            // TODO, we can't use apple's proposed
            // .Apple Symbol Fallback (filtered out below),
            // but not having these makes us not able to render
            // many chars. We add the symbols back in.
            // Investigate if we can actually use the .-prefixed
            // fallbacks somehow.
            if let Ok(apple_symbols) = new_from_name("Apple Symbols", size) {
                fallbacks.push(Font {
                    cg_font: apple_symbols.copy_to_CGFont(),
                    ct_font: apple_symbols,
                    fallbacks: Vec::new(),
                })
            };

            fallbacks
        } else {
            Vec::new()
        };

        Font { ct_font, cg_font, fallbacks }
    }
/// Create a Font from this descriptor.
Create a Font from this descriptor.
Create a Font from this descriptor .
pub fn to_font(&self, size: f64, load_fallbacks: bool) -> Font {
        let ct_font = ct_new_from_descriptor(&self.ct_descriptor, size);
        let cg_font = ct_font.copy_to_CGFont();
        let fallbacks = if load_fallbacks {
            // TODO fixme, hardcoded en for english.
            let mut fallbacks = cascade_list_for_languages(&ct_font, &["en".to_owned()])
                .into_iter()
                .filter(|desc| !desc.font_path.as_os_str().is_empty())
                .map(|desc| desc.to_font(size, false))
                .collect::<Vec<_>>();
            // TODO, we can't use apple's proposed
            // .Apple Symbol Fallback (filtered out below),
            // but not having these makes us not able to render
            // many chars. We add the symbols back in.
            // Investigate if we can actually use the .-prefixed
            // fallbacks somehow.
            if let Ok(apple_symbols) = new_from_name("Apple Symbols", size) {
                fallbacks.push(Font {
                    cg_font: apple_symbols.copy_to_CGFont(),
                    ct_font: apple_symbols,
                    fallbacks: Vec::new(),
                })
            };
            fallbacks
        } else {
            Vec::new()
        };
        Font { ct_font, cg_font, fallbacks }
    }
pub fn to_font ( & self , size : f64 , load_fallbacks : bool ) -> Font { let ct_font = ct_new_from_descriptor ( & self . ct_descriptor , size ) ; let cg_font = ct_font . copy_to_CGFont ( ) ; let fallbacks = if load_fallbacks { // TODO fixme, hardcoded en for english. let mut fallbacks = cascade_list_for_languages ( & ct_font , & [ " " . to_owned ( ) ] ) . into_iter ( ) . filter ( | desc | ! desc . font_path . as_os_str ( ) . is_empty ( ) ) . map ( | desc | desc . to_font ( size , false ) ) . collect :: < Vec < _ > > ( ) ; // TODO, we can't use apple's proposed // .Apple Symbol Fallback (filtered out below), // but not having these makes us not able to render // many chars. We add the symbols back in. // Investigate if we can actually use the .-prefixed // fallbacks somehow. if let Ok ( apple_symbols ) = new_from_name ( " " , size ) { fallbacks . push ( Font { cg_font : apple_symbols . copy_to_CGFont ( ) , ct_font : apple_symbols , fallbacks : Vec :: new ( ) , } ) } ; fallbacks } else { Vec :: new ( ) } ; Font { ct_font , cg_font , fallbacks } }
Create a Font from this descriptor.
Create a Font from this descriptor .
&self
size
f64
load_fallbacks
bool