Class

# Font

<div class="rst-class">

forsearch

</div>

Font

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A <span class="title-ref">Font</span>.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                          | Type                                        | Read-Only | Shared |
|-------------------------------|---------------------------------------------|-----------|--------|
| `Ascent<font.ascent>`         | `Double</api/data_types/double>`            | ✓         |        |
| `CapHeight<font.capheight>`   | `Double</api/data_types/double>`            | ✓         |        |
| `Descent<font.descent>`       | `Double</api/data_types/double>`            | ✓         |        |
| `Handle<font.handle>`         | `Ptr</api/data_types/additional_types/ptr>` | ✓         |        |
| `Leading<font.leading>`       | `Double</api/data_types/double>`            | ✓         |        |
| `LineHeight<font.lineheight>` | `Double</api/data_types/double>`            | ✓         |        |
| `Name<font.name>`             | `String</api/data_types/string>`            | ✓         |        |
| `Size<font.size>`             | `Double</api/data_types/double>`            | ✓         |        |
| `XHeight<font.xheight>`       | `Double</api/data_types/double>`            | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                            | Parameters                                                                                        | Returns                          | Shared |
|-------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------------------------|--------|
| `BoldSystemFont<font.boldsystemfont>`           | size As `Double</api/data_types/double>` = 0.0                                                    | Font                             | ✓      |
| `Constructor<font.constructor0>`                | file As `FolderItem</api/files/folderitem>`, pointSize As `Double</api/data_types/double>`        |                                  |        |
|                                                 | postscriptName As `String</api/data_types/string>`, pointSize As `Double</api/data_types/double>` |                                  |        |
| `FromHandle<font.fromhandle>`                   | handle As `Ptr</api/data_types/additional_types/ptr>`                                             | Font                             | ✓      |
| `ItalicSystemFont<font.italicsystemfont>`       | size As `Double</api/data_types/double>` = 0.0                                                    | Font                             | ✓      |
| `SmallSystemFontSize<font.smallsystemfontsize>` |                                                                                                   | `Double</api/data_types/double>` | ✓      |
| `SystemFont<font.systemfont>`                   | size As `Double</api/data_types/double>` = 0.0                                                    | Font                             | ✓      |
| `SystemFontSize<font.systemfontsize>`           |                                                                                                   | `Double</api/data_types/double>` | ✓      |

## Property descriptions

<div id="font.ascent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Ascent

**Ascent** As `Double</api/data_types/double>`

> The distance between the baseline and the top of the glyph (including diacritical marks) that reaches farthest from the baseline.
>
> This property is read-only.

<div id="font.capheight">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.CapHeight

**CapHeight** As `Double</api/data_types/double>`

> The distance from the baseline to the highest point of a capital letter (not including diacritical marks) above the baseline.
>
> This property is read-only.

<div id="font.descent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Descent

**Descent** As `Double</api/data_types/double>`

> The distance between the baseline and the lowest descending glyph.
>
> This property is read-only.

<div id="font.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> A pointer to the object for use with `declares</api/language/declare>`.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is currently only supported for Android.
>
> </div>

<div id="font.leading">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Leading

**Leading** As `Double</api/data_types/double>`

> The distance between adjacent lines of type.
>
> This property is read-only.

<div id="font.lineheight">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.LineHeight

**LineHeight** As `Double</api/data_types/double>`

> The distance between two adjacent baselines.
>
> This property is read-only.

<div id="font.name">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Name

**Name** As `String</api/data_types/string>`

> The name of the <span class="title-ref">Font</span>.
>
> This property is read-only.

<div id="font.size">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Size

**Size** As `Double</api/data_types/double>`

> The height of the <span class="title-ref">Font</span> in points.
>
> This property is read-only.

<div id="font.xheight">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.XHeight

**XHeight** As `Double</api/data_types/double>`

> The distance between the baseline and the mean line of lower-case letters.
>
> This property is read-only.

## Method descriptions

<div id="font.boldsystemfont">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.BoldSystemFont

**BoldSystemFont**(size As `Double</api/data_types/double>` = 0.0) As Font

> Returns a <span class="title-ref">Font</span> object representing the bold system <span class="title-ref">Font</span> at the size passed.
>
> This method is `shared</api/language/shared>`.

<div id="font.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.Constructor

**Constructor**(file As `FolderItem</api/files/folderitem>`, pointSize As `Double</api/data_types/double>`)

> Returns a <span class="title-ref">Font</span> object for the <span class="title-ref">Font</span> in the *file* passed at the *pointSize* passed.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This constructor is not supported for iOS.
>
> </div>
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

**Constructor**(postscriptName As `String</api/data_types/string>`, pointSize As `Double</api/data_types/double>`)

> Returns a <span class="title-ref">Font</span> object for the <span class="title-ref">Font</span> name passed at the *pointSize* passed.
>
> Get a <span class="title-ref">Font</span> object for the Helvetica <span class="title-ref">Font</span> at 12 point size:
>
> ``` xojo
> Var helvetica12 As New Font("Helvetica", 12)
> ```

<div id="font.fromhandle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.FromHandle

**FromHandle**(handle As `Ptr</api/data_types/additional_types/ptr>`) As Font

> Returns a <span class="title-ref">Font</span> from a `Ptr</api/data_types/additional_types/ptr>`.
>
> Useful when you use declares to get a <span class="title-ref">Font</span>.
>
> This method is `shared</api/language/shared>`.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>

<div id="font.italicsystemfont">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.ItalicSystemFont

**ItalicSystemFont**(size As `Double</api/data_types/double>` = 0.0) As Font

> Returns a <span class="title-ref">Font</span> object representing the italic system <span class="title-ref">Font</span> at the size passed.
>
> This method is `shared</api/language/shared>`.

<div id="font.smallsystemfontsize">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.SmallSystemFontSize

**SmallSystemFontSize** As `Double</api/data_types/double>`

> Returns the <span class="title-ref">Font</span> size of the small system <span class="title-ref">Font</span>.
>
> This method is `shared</api/language/shared>`.

<div id="font.systemfont">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.SystemFont

**SystemFont**(size As `Double</api/data_types/double>` = 0.0) As Font

> Returns a <span class="title-ref">Font</span> object representing the system <span class="title-ref">Font</span> at the size passed.
>
> This method is `shared</api/language/shared>`.

<div id="font.systemfontsize">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Font.SystemFontSize

**SystemFontSize** As `Double</api/data_types/double>`

> Returns the <span class="title-ref">Font</span> size of the system <span class="title-ref">Font</span>.
>
> This method is `shared</api/language/shared>`.

## Notes

Use this class to get information about fonts and assign them to <span class="title-ref">Font</span> properties at runtime.

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | All    |
