Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

FontStyleItem

IGR777 edited this page Aug 30, 2018 · 1 revision

Entity which defines font parameters. Includes font, color, size, letter spacing, line height.

Fields

UIFont Font - font style's font.

Typeface Typeface - font style's font.

UIColor Color Color - font style's color.

float Size - font style's size.

float LetterSpacing - font style's letter spacing

float LineHeight - font style's line height.

Usage

Under the hood Font style set native fields of text, buttons, etc.

Android

Implementation looks like:

base.Typeface = FontStyle.Typeface;
base.TextSize = FontStyle.Size;
base.SetTextColor(FontStyle.Color);
base.LetterSpacing = FontStyle.LetterSpacing;

iOS

Implementation looks like:

base.Font = this.Font.WithSize(TextSize);
this.SetTextSize(TextSize);
base.TextColor = this.TextColor;
this.SetLetterSpacing(LetterSpacing);

SetTextSize and SetLetterSpacing set AttributedString with FontSize and KerningAdjustment.

Clone this wiki locally