Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
ResourceImporterImageFont
繼承: ResourceImporter < RefCounted < Object
Imports a bitmap font where all glyphs have the same width and height.
說明
This image-based workflow can be easier to use than ResourceImporterBMFont, but it requires all glyphs to have the same width and height, glyph advances and drawing offsets can be customized. This makes ResourceImporterImageFont most suited to fixed-width fonts.
See also ResourceImporterDynamicFont.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
Font ascent (number of pixels above the baseline). If set to 0, half of the character height is used.
Rect2i character_margin = Rect2i(0, 0, 0, 0) 🔗
在每個匯入的字形周圍套用邊距。如果您的字型影像包含參考線(以字形之間的線的形式)或字元之間的間距看起來不正確,請嘗試調整character_margin。
PackedStringArray character_ranges = PackedStringArray() 🔗
The character ranges to import from the font image. This is an array that maps each position on the image (in tile coordinates, not pixels). The font atlas is traversed from left to right and top to bottom. Characters can be specified with decimal numbers (126), hexadecimal numbers (0x007e or U+007e), or between single quotes ('~'). Ranges can be specified with a hyphen between characters.
For example, 0-127 represents the full ASCII range. It can also be written as 0x0000-0x007f (or U+0000-U+007f). As another example, ' '-'~' is equivalent to 32-126 and represents the range of printable (visible) ASCII characters.
For any range, the character advance and offset can be customized by appending three space-separated integer values (additional advance, x offset, y offset) to the end. For example 'a'-'b' 4 5 2 sets the advance to char_width + 4 and offset to Vector2(5, 2) for both a and b characters.
Note: The overall number of characters must not exceed the number of columns multiplied by rows. Otherwise, the font will fail to import.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.
精靈表中的列數。
如果為 true,則對二進位資源使用無失真壓縮。
Font descent (number of pixels below the baseline). If set to 0, half of the character height is used.
如果在此點陣字形中找不到字形,則要使用的字形後備列表。首先嘗試陣列開頭的字形。
Rect2i image_margin = Rect2i(0, 0, 0, 0) 🔗
在整個影像兩側進行剪切的邊距。這可用於剪切包含屬性資訊或類似資訊的影像部分。
PackedStringArray kerning_pairs = PackedStringArray() 🔗
Kerning pairs for the font. Kerning pair adjust the spacing between two characters.
Each string consist of three space separated values: "from" string, "to" string and integer offset. Each combination form the two string for a kerning pair, e.g, ab cd -3 will create kerning pairs ac, ad, bc, and bd with offset -3. \uXXXX escape sequences can be used to add Unicode characters.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.
字型映像中的行數。另請參閱 columns。
Font scaling mode.