TW3CustomFont
Unit: SmartCL.Fonts.pas
- Hierarchy
- TObject
- TW3CustomFont
Properties |
---|
Color |
Name |
Size |
Weight |
Methods |
toCssStyle |
Events |
OnChanged |
Properties
Color
Specifies color of Font (color attribute of DOM object).
property Color: TColor read getColor write setColor;
Examples:
W3Button1.Font.Color:= $00ff0000; // RGB order, not BGR like in Delphi W3Button1.Font.Color:= clRed; W3Button1.Font.Color:= StrToColor('#ff0000'); // From web color
Name
Specifies name of Font (fontFamily attribute) of control.
property Name: String read getName write setName;
Examples:
W3Button1.Font.Name:= 'Verdana'; W3Button1.Font.Name:= 'Verdana, Tahoma'; // "backup" fontsW3Button1.Font.Name:= 'Verdana, "Segoe UI"'; // spaces in name
Size
Specifies font size (fontSize DOM attribute) in pixels.
property Size: Integer read getSize write setSize;
Weight
Specifies fontWeight attribute of DOM object.
property Weight: String read getWeight write setWeight;
List of values that may be set:
Value | Description |
---|---|
normal | Defines normal characters. |
bold | Defines thick characters. |
bolder | Defines thicker characters. |
lighter | Defines lighter characters |
100,200,300,400,500,600,700,800,900 | Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold |
inherit | Specifies that the font weight should be inherited from the parent element |
Not all values are supported by all browsers. |
Methods
toCssStyle
Computes all properties into single property value suitable for font CSS attribute.
function toCssStyle: String; virtual;
Example:
W3Panel1.InnerText:= W3Button1.Font.toCssStyle;
Events
OnChanged
Occur after any of properties is changed.
property OnChanged: TNotifyEvent read FOnChange write FOnChange;