# custom font

[SwiftUI](../../..) ⟩ [controls](../..) ⟩ [Text](..) ⟩ [Font]() ⟩ custom font&#x20;

{% tabs %}
{% tab title="💾 程式" %}
```swift
let avenir17 = Font.custom("AvenirNextCondensed-Regular", size:17.0)

Text("Hello").font(avenir17)
```
{% endtab %}

{% tab title="🗺️ 圖表" %}
{% hint style="info" %}
:point\_right: 工具：[iFont](https://apps.apple.com/tw/app/ifont-find-install-any-font/id1173222289) (iPad app)

在這個 app 裡面有可以直接套用的程式碼。
{% endhint %}

<figure><img src="https://1830103165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5-JmwCZMKh_d7RfBaN%2Fuploads%2Fg32vrgWbYVKWPPO6p77d%2FiFont_code.jpeg?alt=media&#x26;token=f58b2d10-fdd4-48cc-9b98-1bb56328a195" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="📘 手冊" %}
* [SwiftUI](https://developer.apple.com/documentation/swiftui) ⟩&#x20;
  * [Font](https://developer.apple.com/documentation/swiftui/font) ⟩ [.custom(\_:size:)](https://developer.apple.com/documentation/swiftui/font/custom\(_:size:\))
  * [Text input and output](https://developer.apple.com/documentation/swiftui/text-input-and-output) ⟩ [Applying custom fonts to text](https://developer.apple.com/documentation/swiftui/applying-custom-fonts-to-text)
{% endtab %}

{% tab title="📗 參考" %}
* ChatGPT ⟩ [SwiftUI 指定字體](https://chatgpt.com/share/6789dc2d-fb5c-800e-b5cb-2f536c2e7fe0)&#x20;
{% endtab %}

{% tab title="🛠 工具" %}
* [iFont](https://apps.apple.com/tw/app/ifont-find-install-any-font/id1173222289)
{% endtab %}
{% endtabs %}
