[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/fonts/ -> class-wp-font-face.php (summary)

WP_Font_Face class.

File Size: 430 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

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.

return: array Prepared font-faces organized by provider and font-family.
param: array $fonts The fonts to valid.

validate_font_face_declarations( array $font_face )   X-Ref
Validates each font-face declaration (property and value pairing).

return: array|false Validated font-face on success, or false on failure.
param: array $font_face Font face property and value pairings to validate.

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.

return: string The `@font-face` CSS styles.
param: array[] $font_faces The font-faces to generate @font-face CSS styles.

order_src( array $font_face )   X-Ref
Orders `src` items to optimize for browser support.

return: array Font-face with ordered src items.
param: array $font_face Font face to process.

build_font_face_css( array $font_face )   X-Ref
Builds the font-family's CSS.

return: string This font-family's CSS.
param: array $font_face Font face to process.

compile_src( array $value )   X-Ref
Compiles the `src` into valid CSS.

return: string The CSS.
param: array $value Value to process.

compile_variations( array $font_variation_settings )   X-Ref
Compiles the font variation settings.

return: string The CSS.
param: array $font_variation_settings Array of font variation settings.



Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref