Commit Graph

158 Commits

Author SHA1 Message Date
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
1ced1f9c99 [TextServer] Pass Dictionary properties by value and check property values instead of references.. 2023-09-07 11:59:51 +03:00
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
31a8a9b2e1 [TextServer] Remove excessive Dictionary checks. 2023-09-04 09:47:55 +03:00
5453503697 [Text Server] Store extra spacing of individual font variations. 2023-08-24 11:58:12 +03:00
b3b791350b Move registration of fallbacks property in the base Font class 2023-08-07 13:46:44 +02:00
de4a3fa151 Unify and streamline connecting to Resource changes 2023-07-17 19:35:57 +02:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
7ee916a259 Fix: Incorrect property names in FontFile::_get_property_list(). 2023-07-01 07:57:47 -05:00
aaddec7cb8 [TextServer] Add support for retrieving OpenType name strings. 2023-05-22 18:08:34 +03:00
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
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
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
8459aeaab0 [Font] Implement get_char_from_glyph_index function. 2023-03-01 09:29:11 +02:00
80ae3feca7 Avoid returning self from _get_base_font_or_default() 2023-02-05 04:37:59 +01:00
2442f6c937 [SystemFont] Add missing MSDF properties. 2023-01-26 09:47:42 +02:00
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
9b53bd90bb [Font] Use key structure instead of raw hash for LRU cache to avoid collisions. 2022-12-24 11:46:40 +02:00
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
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
06a0b26c9e Fix inspector not showing name for LabelSettings.font 2022-11-25 12:48:37 +08:00
5d20dccade Add MAKE_RESOURCE_TYPE_HINT macro to simplify binding arrays of resources 2022-11-24 14:06:00 +01:00
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
01b4e53e80 Add a special case for importing bitmap fonts designed for Godot 3. 2022-11-13 00:32:30 +02:00
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
2aa350f701 [Font] Add support for OEM encoded bitmap fonts. 2022-10-16 18:22:21 +03:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
5bcd019ee9 Merge pull request #66552 from bruvzg/64_bitfields
Change BitField to use 64-bit int.
2022-09-29 10:44:08 +02:00
155694c7c6 Fix Font::_is_cyclic. 2022-09-28 18:11:17 +03:00
8a9659b152 Change BitField to use 64-bit int. 2022-09-28 17:36:59 +03:00
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
2ece5b4a6b [Font] Remove unnecessary cleanup and changed signal emission from the destructor. 2022-09-13 10:28:12 +03:00
10a56981dc Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00
7013c68619 Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0 2022-08-26 11:59:07 +02:00
d6267c2d2c Merge pull request #64305 from bruvzg/ts_reset_data 2022-08-26 11:44:24 +02:00
bcc3643989 Add font LCD sub-pixel anti-aliasing support. 2022-08-23 08:47:21 +03:00
8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
17ca5b913c Merge pull request #64156 from bruvzg/sys_msdf
Allow MSDF rendering for system fonts, fix crash on loading damaged / unsupported font files.
2022-08-18 14:58:57 -06:00
14ddeb8e44 break out of font search loop after first match
The documentation for the font_names property indicates:

   Array of font family names to search, first matching font found is used.
2022-08-15 20:58:48 -08:00
c6e1432cc0 [Font] Set TextServer font data pointer when it's null, to prevent TS from reading old, non-existing data. 2022-08-12 11:35:13 +03:00
bf1cc6326a Allow MSDF rendering for system fonts, fix crash on loading damaged / unsupported font files. 2022-08-09 14:21:09 +03:00
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
cc5135959b Merge pull request #62973 from bruvzg/sysfont_support 2022-07-27 13:38:30 +02:00
7b834c8bfd Fix unnamed arguments in XML docs 2022-07-26 20:42:38 +02:00
36ef8f29dc Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
cbe3a2dcb7 Use BitField hint for the TextServer enums. Add missing parts for BitField support to the GDextension API. 2022-07-15 08:49:50 +03:00
344ba0ffaf Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
141c375581 Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934
* Clean up usage of murmur3
* Fixed usages of binary murmur3 on floats (this is invalid)
* Changed DJB2 to use xor (which seems to be better)
2022-06-20 12:54:19 +02:00
136f84fc35 Merge pull request #61772 from bruvzg/ft_ot_collect 2022-06-13 11:13:05 +02:00