Commit graph

174 commits

Author SHA1 Message Date
bruvzg
e7f215c2c4
[BMFont] Fix importing fonts with Match char height enabled. 2024-08-14 23:52:19 +03:00
bruvzg
5c8a8c57be
[Font] Add check for cyclic base font dependencies. 2024-08-03 00:00:11 +03:00
bruvzg
847aadee02
[Editor] Update font preview directly instead of invalidating property list. 2024-07-05 12:48:39 +03:00
bruvzg
fee14eb5e8
[Import] Add "skip file" import option to skip (and exclude from export) importable formats, auto set it for the images used by bitmap font. 2024-03-12 21:34:40 +02:00
bruvzg
911fa38d3a
[Font] Add option to disable embedded bitmaps loading. 2024-03-11 16:31:10 +02:00
Micky
ba867042a2 Fix Label3D, TextMesh & Font not following project default theme in editor 2024-03-09 17:35:48 +01:00
Rémi Verschelde
7e14974d07
Merge pull request #88185 from bruvzg/font_draw_no_ellipsis
[Font] Do not use trim with ellipsis in the basic Font string drawing functions.
2024-02-15 17:35:44 +01:00
bruvzg
1a5bae9adc
[Font] Do not use trim with ellipsis in the basic Font string drawing functions. 2024-02-11 00:23:35 +02:00
bruvzg
19f1d5afa9
[TextServer / Font] Do not duplicate images to prevent unnecessary embedding. 2024-02-05 10:38:32 +02:00
bruvzg
85df221610
[TextServer / Font] Add support for customizable baseline offset. 2024-01-28 13:26:49 +02:00
Wilson E. Alvarez
a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
Rémi Verschelde
15b8185c68
Don't use TTR/RTR for ERR/WARN prints
We don't translate those, only editor strings are translated.
2023-11-12 12:00:55 +01:00
bruvzg
9a1e0e4aef
[Bitmap fonts] Add support for scaling. 2023-10-13 12:57:45 +03:00
Rémi Verschelde
0f5669be51
Merge pull request #82712 from bruvzg/font_collection_name_select
[SystemFont] Check name when selecting the best matching face from a collection.
2023-10-03 17:27:06 +02:00
bruvzg
a5a0e48dbc
[SystemFont] Check name when selecting the best matching face from a collection. 2023-10-03 09:40:48 +03:00
bruvzg
4a167fc740
[TextServer] Store font extra spacing variations without making a full copy of font. 2023-09-28 10:45:09 +03:00
Rémi Verschelde
31a7fd1951
Merge pull request #81406 from bruvzg/ts_dict_chk2
[TextServer] Pass Dictionary properties by value and check property values instead of references.
2023-09-08 09:11:23 +02:00
bruvzg
1ced1f9c99
[TextServer] Pass Dictionary properties by value and check property values instead of references.. 2023-09-07 11:59:51 +03:00
Yuri Sizov
58126e479c Introduce the concept of global theme contexts
This commit adds the default theme context, which replaces
the need to manually check the project and the default theme
all the time; simplifies related code.

It also adds framework for custom theme contexts, to be used
by the editor. Custom contexts can be attached to any node,
and not necessarily a GUI/Window node. Contexts do no break
theme inheritance and only define which global themes a node
uses as a fallback.

Contexts propagate NOTIFICATION_THEME_CHANGED when one of their
global themes changes. This ensures that global themes act just
like themes assigned to individual nodes and can be previewed
live in the editor.
2023-09-06 19:40:43 +02:00
bruvzg
31a8a9b2e1
[TextServer] Remove excessive Dictionary checks. 2023-09-04 09:47:55 +03:00
bruvzg
5453503697
[Text Server] Store extra spacing of individual font variations. 2023-08-24 11:58:12 +03:00
Faolan
b3b791350b
Move registration of fallbacks property in the base Font class 2023-08-07 13:46:44 +02:00
kobewi
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
Hendrik Brucker
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
Ben Rog-Wilhelm
7ee916a259 Fix: Incorrect property names in FontFile::_get_property_list(). 2023-07-01 07:57:47 -05:00
bruvzg
aaddec7cb8
[TextServer] Add support for retrieving OpenType name strings. 2023-05-22 18:08:34 +03:00
bruvzg
9163d8c336
Expose TextServer justification flags to Label, Label3D, TextMesh and RTL. Add flags to control last/single line justification. 2023-05-15 19:23:54 +03:00
Yuri Sizov
98d95f3a0e
Merge pull request #74149 from bruvzg/get_char
[Font] Implement `get_char_from_glyph_index` function.
2023-03-16 13:07:11 +01:00
bruvzg
67762ec4a6
[Bitmap font] Assume outline size is 1 if it's not set, but channel for outline is defined. 2023-03-02 08:36:17 +02:00
bruvzg
8459aeaab0
[Font] Implement get_char_from_glyph_index function. 2023-03-01 09:29:11 +02:00
Patrick Dawson
80ae3feca7 Avoid returning self from _get_base_font_or_default() 2023-02-05 04:37:59 +01:00
bruvzg
2442f6c937
[SystemFont] Add missing MSDF properties. 2023-01-26 09:47:42 +02:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
bruvzg
9b53bd90bb
[Font] Use key structure instead of raw hash for LRU cache to avoid collisions. 2022-12-24 11:46:40 +02:00
bruvzg
ecec415988
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts.
Add function to get system fallback font from a font name, style, text, and language code.
Implement system font support for Android.
Use system fonts as a last resort fallback.
2022-12-04 18:44:20 +02:00
Rémi Verschelde
ead82feb24
Merge pull request #69008 from akien-mga/property-hint-array-type-resource-simplify
Add MAKE_RESOURCE_TYPE_HINT macro to simplify binding arrays of resources
2022-11-25 19:29:05 +01:00
Haoyu Qiu
06a0b26c9e Fix inspector not showing name for LabelSettings.font 2022-11-25 12:48:37 +08:00
Rémi Verschelde
5d20dccade
Add MAKE_RESOURCE_TYPE_HINT macro to simplify binding arrays of resources 2022-11-24 14:06:00 +01:00
bruvzg
e77b6427cb
[Bitmap font] Always set valid fixed size, even if it's not set in the fnt file. 2022-11-14 22:33:59 +02:00
bruvzg
01b4e53e80
Add a special case for importing bitmap fonts designed for Godot 3. 2022-11-13 00:32:30 +02:00
Hugo Locurcio
a19e389f4f
Hide Antialiasing import option on DynamicFonts with MSDF enabled
Antialiasing cannot be adjusted on fonts rendered with MSDF.
Internally, Godot always uses grayscale antialiasing for those fonts.

This also tweaks property hints for consistency, and renames
uses of "sub-pixel" to the more commonly used "subpixel".
2022-11-03 18:40:44 +01:00
bruvzg
2aa350f701
[Font] Add support for OEM encoded bitmap fonts. 2022-10-16 18:22:21 +03:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Rémi Verschelde
5bcd019ee9 Merge pull request #66552 from bruvzg/64_bitfields
Change BitField to use 64-bit int.
2022-09-29 10:44:08 +02:00
bruvzg
155694c7c6
Fix Font::_is_cyclic. 2022-09-28 18:11:17 +03:00
bruvzg
8a9659b152
Change BitField to use 64-bit int. 2022-09-28 17:36:59 +03:00
Rindbee
332c566a6c Let the cached TextLine reset the width in get_string_size
Previously, the cached `TextLine` would set the width in `draw_string`, but not in `get_string_size`,
which resulted in unexpected results returned by `get_string_size` in some cases.
2022-09-21 19:47:36 +08:00
bruvzg
2ece5b4a6b
[Font] Remove unnecessary cleanup and changed signal emission from the destructor. 2022-09-13 10:28:12 +03:00
Aaron Franke
10a56981dc
Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
Yuri Sizov
6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00