Gets the @font-face
CSS styles for locally-hosted font files.
Description
This method does the following processing tasks:
- Orchestrates an optimized
src
(with format) for browser support. - Generates the
@font-face
for all its fonts.
Parameters
$font_faces
array[]required- The font-faces to generate @font-face CSS styles.
Source
private function get_css( $font_faces ) {
$css = '';
foreach ( $font_faces as $font_face ) {
// Order the font's `src` items to optimize for browser support.
$font_face = $this->order_src( $font_face );
// Build the @font-face CSS for this font.
$css .= '@font-face{' . $this->build_font_face_css( $font_face ) . '}' . "\n";
}
// Don't print the last newline character.
return rtrim( $css, "\n" );
}
Changelog
Version | Description |
---|---|
6.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.