libcss
Loading...
Searching...
No Matches
Functions
font_face.c File Reference
#include <string.h>
#include "select/font_face.h"

Functions

css_error css__font_face_create (css_font_face **result)
 
css_error css__font_face_destroy (css_font_face *font_face)
 
css_error css__font_face_set_font_family (css_font_face *font_face, lwc_string *font_family)
 
css_error css_font_face_get_font_family (const css_font_face *font_face, lwc_string **font_family)
 
uint8_t css_font_face_font_style (const css_font_face *font_face)
 
uint8_t css_font_face_font_weight (const css_font_face *font_face)
 
css_error css_font_face_count_srcs (const css_font_face *font_face, uint32_t *count)
 
css_error css_font_face_get_src (const css_font_face *font_face, uint32_t index, const css_font_face_src **src)
 
css_error css_font_face_src_get_location (const css_font_face_src *src, lwc_string **location)
 
css_font_face_location_type css_font_face_src_location_type (const css_font_face_src *src)
 
css_font_face_format css_font_face_src_format (const css_font_face_src *src)
 
css_error css__font_face_set_srcs (css_font_face *font_face, css_font_face_src *srcs, uint32_t n_srcs)
 

Function Documentation

◆ css__font_face_create()

css_error css__font_face_create ( css_font_face **  result)

Create a font-face

Parameters
resultPointer to location to receive result
Returns
CSS_OK on success, CSS_NOMEM on memory exhaustion, CSS_BADPARM on bad parameters.

◆ css__font_face_destroy()

css_error css__font_face_destroy ( css_font_face font_face)

Destroy a font-face

Parameters
font_faceFont-face to destroy
Returns
CSS_OK on success, appropriate error otherwise

◆ css__font_face_set_font_family()

css_error css__font_face_set_font_family ( css_font_face font_face,
lwc_string *  font_family 
)

Set a font-face's font-family name

Parameters
font_faceThe font-face
font_familyFont-family name
resultPointer to location to receive result
Returns
CSS_OK on success, CSS_BADPARM on bad parameters.

◆ css__font_face_set_srcs()

css_error css__font_face_set_srcs ( css_font_face font_face,
css_font_face_src srcs,
uint32_t  n_srcs 
)

Set a font-faces array of srcs.

Parameters
font_faceThe font-face
srcsThe array of css_font_face_srcs
n_srcsThe count of css_font_face_srcs in the array
Returns
The format, if specified

◆ css_font_face_count_srcs()

css_error css_font_face_count_srcs ( const css_font_face font_face,
uint32_t *  count 
)

Get the number of potential src locations for a font-face

Parameters
font_faceThe font-face
countPointer to location to receive result
Returns
CSS_OK on success, CSS_BADPARM on bad parameters.

◆ css_font_face_font_style()

uint8_t css_font_face_font_style ( const css_font_face font_face)

Get the style of font for a font-face.

Parameters
srcThe font-face
Returns
The style, as a css_font_style_e

◆ css_font_face_font_weight()

uint8_t css_font_face_font_weight ( const css_font_face font_face)

Get the weight of font for a font-face.

Parameters
srcThe font-face
Returns
The style, as a css_font_weight_e

◆ css_font_face_get_font_family()

css_error css_font_face_get_font_family ( const css_font_face font_face,
lwc_string **  font_family 
)

Get a font-face's font-family name

Parameters
font_faceThe font-face
resultPointer to location to receive result
Returns
CSS_OK on success, CSS_BADPARM on bad parameters.

◆ css_font_face_get_src()

css_error css_font_face_get_src ( const css_font_face font_face,
uint32_t  index,
const css_font_face_src **  src 
)

Get a specific src location from a font-face

Parameters
font_faceThe font-face
indexThe index for the wanted src.
countPointer to location to receive result
Returns
CSS_OK on success, CSS_BADPARM on bad parameters.

◆ css_font_face_src_format()

css_font_face_format css_font_face_src_format ( const css_font_face_src src)

Get the format of font for a font-face src.

Parameters
srcThe font-face src
Returns
The format, if specified

◆ css_font_face_src_get_location()

css_error css_font_face_src_get_location ( const css_font_face_src src,
lwc_string **  location 
)

Get the location for a font-face src.

Parameters
font_faceThe font-face
countPointer to location to receive result
Returns
CSS_OK on success, CSS_BADPARM on bad parameters.
Note
The type of location (local or URL) can be gathered from css_font_face_src_location_type, and the format of font (if specified) from css_font_face_src_format.

◆ css_font_face_src_location_type()

css_font_face_location_type css_font_face_src_location_type ( const css_font_face_src src)

Get the location type for a font-face src.

Parameters
srcThe font-face src
Returns
The location type