[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
WP_Font_Face class.
File Size: | 430 lines (10 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
WP_Font_Face:: (11 methods):
__construct()
generate_and_print()
validate_fonts()
validate_font_face_declarations()
get_style_element()
generate_style_element_attributes()
get_css()
order_src()
build_font_face_css()
compile_src()
compile_variations()
Class: WP_Font_Face - X-Ref
Font Face generates and prints `@font-face` styles for given fonts.__construct() X-Ref |
Creates and initializes an instance of WP_Font_Face. |
generate_and_print( array $fonts ) X-Ref |
No description |
validate_fonts( array $fonts ) X-Ref |
Validates each of the font-face properties. param: array $fonts The fonts to valid. return: array Prepared font-faces organized by provider and font-family. |
validate_font_face_declarations( array $font_face ) X-Ref |
Validates each font-face declaration (property and value pairing). param: array $font_face Font face property and value pairings to validate. return: array|false Validated font-face on success, or false on failure. |
get_style_element() X-Ref |
Gets the style element for wrapping the `@font-face` CSS. return: string The style element. |
generate_style_element_attributes() X-Ref |
Gets the defined <style> element's attributes. return: string A string of attribute=value when defined, else, empty string. |
get_css( $font_faces ) X-Ref |
Gets the `@font-face` CSS styles for locally-hosted font files. This method does the following processing tasks: 1. Orchestrates an optimized `src` (with format) for browser support. 2. Generates the `@font-face` for all its fonts. param: array[] $font_faces The font-faces to generate @font-face CSS styles. return: string The `@font-face` CSS styles. |
order_src( array $font_face ) X-Ref |
Orders `src` items to optimize for browser support. param: array $font_face Font face to process. return: array Font-face with ordered src items. |
build_font_face_css( array $font_face ) X-Ref |
Builds the font-family's CSS. param: array $font_face Font face to process. return: string This font-family's CSS. |
compile_src( array $value ) X-Ref |
Compiles the `src` into valid CSS. param: array $value Value to process. return: string The CSS. |
compile_variations( array $font_variation_settings ) X-Ref |
Compiles the font variation settings. param: array $font_variation_settings Array of font variation settings. return: string The CSS. |
Generated : Thu Nov 21 08:20:01 2024 | Cross-referenced by PHPXref |