# 02.使用TTF字体

在项目的 `Info.plist` 中添加 `Fonts provided by application` 在其中填入字体文件名

![](http://ohfpqyfi7.bkt.clouddn.com/15066076915843.jpg)

![](http://ohfpqyfi7.bkt.clouddn.com/15066114496262.jpg)

* 可以通过下面的方式通过 `fontName` 设置 `font`

```swift
let familyNames = UIFont.familyNames
        for familyName in familyNames {
            print("++++++ " + familyName + " ++++++")
            let fontNames = UIFont.fontNames(forFamilyName: familyName)
            for fontName in fontNames {
                print(fontName)
            }
            print("=================================")
        }

        return UIFont(name: "hahahahahaah", size: fontSize)!
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ryukiedev.gitbook.io/wiki/ios/za-xiang/shi-yong-ttf-zi-ti.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
