libcss
Loading...
Searching...
No Matches
Functions
unit.h File Reference
#include <libcss/unit.h>

Go to the source code of this file.

Functions

css_fixed css_unit_len2px_mq (const css_unit_ctx *ctx, const css_fixed length, const css_unit unit)
 
css_error css_unit_compute_absolute_font_size (const css_hint_length *ref_length, const css_computed_style *root_style, css_fixed font_size_default, css_hint *size)
 
css_fixed css_unit_angle2deg (const css_unit unit, const css_fixed angle)
 

Function Documentation

◆ css_unit_angle2deg()

css_fixed css_unit_angle2deg ( const css_unit  unit,
const css_fixed  angle 
)

Convert any angle to degrees.

It is invalid to call this with a unit which isn't of UNIT_ANGLE

Parameters
[in]unitThe unit the angle is in
[in]angleThe angle to convert
Returns
the angle in degrees

◆ css_unit_compute_absolute_font_size()

css_error css_unit_compute_absolute_font_size ( const css_hint_length ref_length,
const css_computed_style root_style,
css_fixed  font_size_default,
css_hint size 
)

Convert relative font size units to absolute units.

Parameters
[in]ref_lengthReference font-size length or NULL.
[in]root_styleRoot element style or NULL.
[in]font_size_defaultClient default font size in CSS pixels.
[in,out]sizeThe length to convert.
Returns
CSS_OK on success, or appropriate error otherwise.

◆ css_unit_len2px_mq()

css_fixed css_unit_len2px_mq ( const css_unit_ctx ctx,
const css_fixed  length,
const css_unit  unit 
)

Convert a length to CSS pixels for a media query context.

Parameters
[in]ctxDocument unit conversion context.
[in]lengthLength to convert.
[in]unitCurrent unit of length.
Returns
A length in CSS pixels.