WPDev.one
Core Class

WP_Font_Face

class WP_Font_Face // Constructor: function Object() { [native code] }

Font Face generates and prints `@font-face` styles for given fonts.

Methods 11 methods

Method / Return Description
__construct()
void

Creates and initializes an instance of WP_Font_Face.

generate_and_print()
void

Generates and prints the `@font-face` styles for the given fonts.

Parameters: $fonts: array
validate_fonts()
array

Validates each of the font-face properties.

Parameters: $fonts: array
validate_font_face_declarations()
(array

Validates each font-face declaration (property and value pairing).

Parameters: $font_face: array
get_style_element()
string

Gets the style element for wrapping the `@font-face` CSS.

generate_style_element_attributes()
string

Gets the defined <style> element's attributes.

get_css()
string

Gets the `@font-face` CSS styles for locally-hosted font files.

Parameters: $font_faces: mixed
order_src()
array

Orders `src` items to optimize for browser support.

Parameters: $font_face: array
build_font_face_css()
string

Builds the font-family's CSS.

Parameters: $font_face: array
compile_src()
string

Compiles the `src` into valid CSS.

Parameters: $value: array
compile_variations()
string

Compiles the font variation settings.

Parameters: $font_variation_settings: array

Properties

Property / Type Description
$font_face_property_defaults
mixed
public
No description available.
$valid_font_face_properties
mixed
public
No description available.
$valid_font_display
mixed
public
No description available.
$style_tag_attrs
mixed
public
No description available.

Class Information

Since Version
6.4.0
Source File
wp-includes/fonts/class-wp-font-face.php
Advertisement