function typography(){
		
		foreach (get_option_array() as $mid){
			
			foreach($mid as $oid => $o){ 
				
				if($o['type'] == 'typography'){
					
					$type_foundry = new PageLinesFoundry;

					$type = pagelines_option($oid);
					
					$font_id = $type['font'];
					
					// Don't render if font isn't set.
					if(isset($font_id) && isset($type_foundry->foundry[$font_id]) ){
						
						if($type_foundry->foundry[$font_id]['google'])
							$google_fonts[] = $font_id;

						$type_selectors = $o['selectors']; 

						if( isset($type['selectors']) && !empty($type['selectors']) ) $type_selectors .=  ',' . trim(trim($type['selectors']), ",");

						$type_css = $type_foundry->get_type_css($type);
					
					
						$type_css_keys[] = $type_selectors . "{".$type_css."}".$this->nl;
					}
					
				}
				
			}
		}
		
		if(isset($google_fonts) && is_array($google_fonts )){
			
			if( $this->comments ) $this->css .= '/* Import Google Fonts --------------- */'.$this->nl2;
			
			$this->css .= $type_foundry->google_import($google_fonts) . $this->nl;
			
		}
		
		if( $this->comments ) $this->css .= '/* Set Type --------------- */'.$this->nl2;
		
		// Render the font CSS
		if(isset($type_css_keys) && is_array($type_css_keys)){
			foreach($type_css_keys as $typeface){
				$this->css .= $typeface .$this->nl;
			}
		}

	}
Пример #2
0
/**
*
* @TODO do
*
*/
function load_custom_font($font, $selectors)
{
    if ($font) {
        $foundry = new PageLinesFoundry();
        if (!isset($foundry->foundry[$font])) {
            return '';
        }
        $rule = sprintf('%s{font-family: %s;}', $selectors, $foundry->foundry[$font]['family']);
        $import = $foundry->foundry[$font]['google'] ? $foundry->get_the_import($font) : '';
        return sprintf('<style type="text/css">%s%s</style>', $import, $rule);
    } else {
        return '';
    }
}
Пример #3
0
 /**
  *
  * @TODO document
  *
  */
 function typography()
 {
     $foundry = new PageLinesFoundry();
     $this->css .= $foundry->render_css();
 }