class_resourceimporterimagefont.rst 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ResourceImporterImageFont.xml.
  6. .. _class_ResourceImporterImageFont:
  7. ResourceImporterImageFont
  8. =========================
  9. **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Imports a fixed-width bitmap font where all glyphs have the same width and height.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This image-based workflow can be easier to use than :ref:`ResourceImporterBMFont<class_ResourceImporterBMFont>`, but it requires all glyphs to have the same width and height. This makes **ResourceImporterImageFont** most suited to fixed-width fonts.
  15. See also :ref:`ResourceImporterDynamicFont<class_ResourceImporterDynamicFont>`.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `Bitmap fonts - Using fonts <../tutorials/ui/gui_using_fonts.html#bitmap-fonts>`__
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  26. | :ref:`Rect2i<class_Rect2i>` | :ref:`character_margin<class_ResourceImporterImageFont_property_character_margin>` | ``Rect2i(0, 0, 0, 0)`` |
  27. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  28. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`character_ranges<class_ResourceImporterImageFont_property_character_ranges>` | ``PackedStringArray()`` |
  29. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  30. | :ref:`int<class_int>` | :ref:`columns<class_ResourceImporterImageFont_property_columns>` | ``1`` |
  31. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`compress<class_ResourceImporterImageFont_property_compress>` | ``true`` |
  33. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  34. | :ref:`Array<class_Array>` | :ref:`fallbacks<class_ResourceImporterImageFont_property_fallbacks>` | ``[]`` |
  35. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  36. | :ref:`Rect2i<class_Rect2i>` | :ref:`image_margin<class_ResourceImporterImageFont_property_image_margin>` | ``Rect2i(0, 0, 0, 0)`` |
  37. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  38. | :ref:`int<class_int>` | :ref:`rows<class_ResourceImporterImageFont_property_rows>` | ``1`` |
  39. +---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Property Descriptions
  44. ---------------------
  45. .. _class_ResourceImporterImageFont_property_character_margin:
  46. .. rst-class:: classref-property
  47. :ref:`Rect2i<class_Rect2i>` **character_margin** = ``Rect2i(0, 0, 0, 0)``
  48. Margin applied around every imported glyph. If your font image contains guides (in the form of lines between glyphs) or if spacing between characters appears incorrect, try adjusting :ref:`character_margin<class_ResourceImporterImageFont_property_character_margin>`.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_ResourceImporterImageFont_property_character_ranges:
  52. .. rst-class:: classref-property
  53. :ref:`PackedStringArray<class_PackedStringArray>` **character_ranges** = ``PackedStringArray()``
  54. 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 (127), hexadecimal numbers (``0x007f``) or between single quotes (``'~'``). Ranges can be specified with a hyphen between characters.
  55. For instance, ``0-127`` (or ``0x0000-0x007f``) denotes the full ASCII range. As another example, ``' '-'~'`` is equivalent to ``32-127`` and denotes the range of printable (visible) ASCII characters.
  56. Make sure :ref:`character_ranges<class_ResourceImporterImageFont_property_character_ranges>` doesn't exceed the number of :ref:`columns<class_ResourceImporterImageFont_property_columns>` \* :ref:`rows<class_ResourceImporterImageFont_property_rows>` defined. Otherwise, the font will fail to import.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_ResourceImporterImageFont_property_columns:
  60. .. rst-class:: classref-property
  61. :ref:`int<class_int>` **columns** = ``1``
  62. Number of columns in the font image. See also :ref:`rows<class_ResourceImporterImageFont_property_rows>`.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_ResourceImporterImageFont_property_compress:
  66. .. rst-class:: classref-property
  67. :ref:`bool<class_bool>` **compress** = ``true``
  68. If ``true``, uses lossless compression for the resulting font.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_ResourceImporterImageFont_property_fallbacks:
  72. .. rst-class:: classref-property
  73. :ref:`Array<class_Array>` **fallbacks** = ``[]``
  74. List of font fallbacks to use if a glyph isn't found in this bitmap font. Fonts at the beginning of the array are attempted first.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_ResourceImporterImageFont_property_image_margin:
  78. .. rst-class:: classref-property
  79. :ref:`Rect2i<class_Rect2i>` **image_margin** = ``Rect2i(0, 0, 0, 0)``
  80. Margin to cut on the sides of the entire image. This can be used to cut parts of the image that contain attribution information or similar.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_ResourceImporterImageFont_property_rows:
  84. .. rst-class:: classref-property
  85. :ref:`int<class_int>` **rows** = ``1``
  86. Number of rows in the font image. See also :ref:`columns<class_ResourceImporterImageFont_property_columns>`.
  87. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  88. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  89. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  90. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  91. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  92. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  93. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`