<div class="meta" robots="noindex">

</div>

Method

# Font

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `System.FontAt<system.fontat>` as a replacement.

</div>

## Description

Used to access the names the installed fonts (0-based).

## Usage

*result* = **Font**(*index*)

| Part   | Type                               | Description                                                                                             |
|--------|------------------------------------|---------------------------------------------------------------------------------------------------------|
| result | `String</api/data_types/string>`   | The name of the font whose index number is passed. *Result* is in the appropriate WorldScript encoding. |
| index  | `Integer</api/data_types/integer>` | The number of the font (0-based).                                                                       |

<div class="warning">

<div class="title">

Warning

</div>

An `OutOfBoundsException</api/exceptions/outofboundsexception>` is raised if *index* is less than 0 or greater than `System<system.fontcount>` - 1.

</div>

## Notes

Fonts are accessed in alphabetical order where <span class="title-ref">Font</span> 0 is the first <span class="title-ref">Font</span>. Use the `System<system.fontcount>` function to determine the number of fonts.

Under macOS, <span class="title-ref">Font</span> returns <span class="title-ref">Font</span> families instead of fonts. This is closer to the older Carbon behavior, but it does not return identical results.

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

### Using custom fonts in your applications

Both macOS and Windows have techniques for loading fonts for a specific application.

On macOS, you can use [ATSApplicationFontsPath](http://developer.apple.com/library/mac/#documentation/general/Reference/InfoPlistKeyReference/Articles/GeneralPurposeKeys.html) key in Info.plist. You add this key, specifying the relative path of the fonts in the Resources folder of your app bundle.

For Windows, the open-source [Windows Functionality Suite](https://github.com/arbp/WFS) provides a method (TemporarilyInstallFont) to do this.

## Sample code

This is a function that determines if the <span class="title-ref">Font</span> named passed is installed on the user's computer:

``` xojo
Function FontAvailable(FontName As String) As Boolean
  Dim fc As Integer
  fc = FontCount - 1

  For i As Integer = 0 To fc
    If Font(i) = FontName Then
      Return True
    End If
  Next
  Return False
End Function
```

## Compatibility

All project types on all supported operating systems.

## See also

`System<system.fontcount>` function; `User Interface Considerations for macOS</topics/user_interface/desktop/macos/user_interface_considerations_for_macos/font_display>` topic
