import_font_file
Import .ttf/.otf/.ttc/.otc fonts from disk as UFontFace assets, optionally creating the companion UFont needed to render text headlessly in Unreal Engine.
Instructions
Import a .ttf/.otf/.ttc/.otc font from disk as a UFontFace, and optionally the companion UFont that a FSlateFontInfo needs to actually render text. This is the only way to get a typeface into the project headlessly: import_asset is images-only on purpose, and nothing else in the toolset touches fonts. Drives UFontFileImportFactory inline (never IAssetTools::ImportAssets, which asserts when re-entered from the engine tick, same reason import_asset avoids it) and ALWAYS sets BatchCreateFontAsset explicitly -- left at its default the factory pops a MODAL DIALOG asking whether to create the UFont, which would hang the editor on a click that is never coming. Once imported, point a widget at it with set_widget_property on the dotted path "Font.FontObject" (a UFont) plus "Font.TypefaceFontName", or "Font.Size" for the size.
Returns: { source_file_path, destination_path, imported_object_path, font_face_created, create_font_asset, message }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional asset name; defaults to the source file's base name. | |
| destination_path | Yes | UE long path of the destination content folder, e.g. /Game/MyGame/UI/Fonts. | |
| source_file_path | Yes | Absolute path on disk to the .ttf/.otf/.ttc/.otc file. A missing file, or any other extension, is a clean error before anything is touched. | |
| create_font_asset | No | Also create the companion UFont asset (default true). A UFontFace alone is a raw typeface: a FSlateFontInfo's FontObject wants a UFont. Pass false to import only the face, e.g. to add it as another typeface entry of an existing font. |