FontEngine 用于访问源字体文件中的数据。这些数据包括有关在文本解析、布局和渲染过程中通常使用的各个字符、字形和相关指标的信息。
支持的字体文件类型为 TrueType (.ttf, .ttc) 和 OpenType (.otf)。
FontEngine 还用于对给定字体图集纹理中称为字形的字符直观表示进行栅格化。
DestroyFontEngine | 销毁和卸载字体引擎使用的资源。 |
GetFaceInfo | 获取当前所加载的相应大小的字体的 FaceInfo。 |
GetFontFaces | Gets the font faces and styles for the currently loaded font. |
GetSystemFontNames | Gets the family and style names of the system fonts. |
InitializeFontEngine | 初始化字体引擎和所需的资源。 |
LoadFontFace | 加载源字体文件。 |
SetFaceSize | 设置当前所加载字体的大小。 |
TryGetGlyphIndex | 尝试获取给定 Unicode 值的字符的字形索引。 |
TryGetGlyphWithIndexValue | 尝试加载给定索引值的字形,如果可用,则填充该字形。 |
TryGetGlyphWithUnicodeValue | 尝试加载给定 Unicode 值的字形。如果可用,填充该字形并返回 true。否则返回 false 并使用 .notdef/缺失字形数据填充该字形。 |
UnloadAllFontFaces | Unloads all currently loaded font faces and removes them from the cache. |
UnloadFontFace | Unloads current font face and removes it from the cache. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.