Skip to content

Typography

Taiizor edited this page Mar 1, 2023 · 2 revisions

Typography Extension

Namespace: Skylark.Standard.Extension.Typography

Assembly: Skylark.Standard.dll

Description

This class provides extension methods for converting pixel measurements to other typographic units.

Methods

PixelToEm(decimal Pixel = MTTM.Value, decimal Coefficient = MTTM.Pixel_Em_Coefficient, decimal Constant = MTTM.Pixel_Em_Constant)

Converts pixels to ems based on the given coefficient and constant values. Throws a Skylark.Exception if an error occurs.

Parameters:

  • Pixel (decimal): The number of pixels to convert. Defaults to the value specified in MTTM.
  • Coefficient (decimal): The coefficient value to use in the conversion formula. Defaults to the value specified in MTTM.
  • Constant (decimal): The constant value to use in the conversion formula. Defaults to the value specified in MTTM.

Returns:

The number of ems equivalent to the specified number of pixels.

PixelToEmAsync(decimal Pixel = MTTM.Value, decimal Coefficient = MTTM.Pixel_Em_Coefficient, decimal Constant = MTTM.Pixel_Em_Constant)

Converts pixels to ems asynchronously based on the given coefficient and constant values.

Parameters:

  • Pixel (decimal): The number of pixels to convert. Defaults to the value specified in MTTM.
  • Coefficient (decimal): The coefficient value to use in the conversion formula. Defaults to the value specified in MTTM.
  • Constant (decimal): The constant value to use in the conversion formula. Defaults to the value specified in MTTM.

Returns:

A Task object representing the asynchronous operation, which when completed returns the number of ems equivalent to the specified number of pixels.

PixelToRem(decimal Pixel = MTTM.Value, decimal Coefficient = MTTM.Pixel_Rem_Coefficient, decimal Constant = MTTM.Pixel_Rem_Constant)

Converts pixels to rems based on the given coefficient and constant values. Throws a Skylark.Exception if an error occurs.

Parameters:

  • Pixel (decimal): The number of pixels to convert. Defaults to the value specified in MTTM.
  • Coefficient (decimal): The coefficient value to use in the conversion formula. Defaults to the value specified in MTTM.
  • Constant (decimal): The constant value to use in the conversion formula. Defaults to the value specified in MTTM.

Returns:

The number of rems equivalent to the specified number of pixels.

PixelToRemAsync(decimal Pixel = MTTM.Value, decimal Coefficient = MTTM.Pixel_Rem_Coefficient

Clone this wiki locally