Commit Graph

87 Commits

Author SHA1 Message Date
b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
19f360d65a Add font import flag to toggle modulation of colored glyphs. 2025-04-01 13:36:10 +03:00
331a43a9d8 Add String::remove_char(s) methods for performance and convenience 2025-03-10 13:19:28 +01:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
70a8421c30 Apply fix_alpha_edges for both theme icons and font glyphs.
Only apply fix_alpha_edges for SVG glyphs.
Allow modulate for svg glyphs.
2025-02-18 13:10:28 -08:00
cc1db569e1 [TextServer] Improve embedded objects handling performance. 2025-01-07 08:01:29 +02:00
26e7b6bdd6 Merge pull request #99164 from bruvzg/int_files
[Export] Write text server data from memory, instead of using temporary file.
2024-12-03 14:40:58 -06:00
c5ca56f40b [Export] Write text server data from memory, instead of using temporary file. 2024-12-02 18:22:55 +02:00
e81a2afbc4 [TextServer] Reset subpixel shift on blank glyphs and import option to enable/disable it. 2024-11-01 10:18:57 +02:00
d222daa9c8 [TextServer] Silently skip invalid system fallback fonts. 2024-10-01 17:22:16 +03:00
b37fc1014a Style: Apply new clang-format changes 2024-09-20 08:09:48 -05:00
2fc5321d39 TextServerFallback: improve performance by removing redundant lookups
+ caching editor setting
+ using a faster hash method on the FontForSizeFallback cache
+ SafeFlag instead of mutex for ShapedTextDataFallback::valid bc its read Very often
2024-08-28 13:10:43 -07:00
32bc1c2f33 [Font Import] Detect pixel fonts and disable subpixel positioning. 2024-07-23 20:34:39 +03:00
e651421905 [TextServer, GDExtension] Fix building text servers as GDExtension, expose new/changed low-level methods to GDExtension API. 2024-06-12 19:30:19 +03:00
a0dbdcc3ab Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
1f8387f8fd [TextServer] Improve empty glyph handling to allow glyphs smaller than 2px and avoid unnecessary texture updates. 2024-04-07 18:19:45 +03:00
27f6f4147b [TextServer] Expose ICU title case string conversion to scripting. 2024-04-04 10:56:49 +03:00
061e0c758d Merge pull request #89395 from bruvzg/rtl_ts_img_range
[RTL] Use "visible characters" property for inline object visibility
2024-03-12 14:23:03 +01:00
433de7f1a8 [RTL] Use "visible characters" property for inline object visibility 2024-03-12 11:28:45 +02:00
911fa38d3a [Font] Add option to disable embedded bitmaps loading. 2024-03-11 16:31:10 +02:00
19f1d5afa9 [TextServer / Font] Do not duplicate images to prevent unnecessary embedding. 2024-02-05 10:38:32 +02:00
85df221610 [TextServer / Font] Add support for customizable baseline offset. 2024-01-28 13:26:49 +02:00
91b24b2780 Use GODOT_MODULE define in TextServer modules 2024-01-06 01:19:29 -06:00
56579f397d [Text Overrun] Add option to set custom ellipsis character, add support for system font fallback. 2023-12-04 08:21:42 +02:00
9a1e0e4aef [Bitmap fonts] Add support for scaling. 2023-10-13 12:57:45 +03:00
4a167fc740 [TextServer] Store font extra spacing variations without making a full copy of font. 2023-09-28 10:45:09 +03:00
5453503697 [Text Server] Store extra spacing of individual font variations. 2023-08-24 11:58:12 +03:00
5d3fcc5766 [TextServer] Fix system font fallback and caret/selection behavior for composite characters. 2023-08-15 11:42:40 +03:00
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
25b2f1780a Style: Harmonize header includes in modules
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
2023-06-15 14:35:45 +02: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
a8d2e7f342 Merge pull request #73987 from bruvzg/ft_lock
[TextServer] Add mutex for FreeType face creation/deletion operations.
2023-03-03 11:04:07 +01:00
8459aeaab0 [Font] Implement get_char_from_glyph_index function. 2023-03-01 09:29:11 +02:00
bbc77b6d29 Fix text server GDExtension build. 2023-02-26 18:38:22 +02:00
c950a1ab94 [TextServer] Add mutex for FreeType face creation/deletion operations. 2023-02-26 17:55:04 +02:00
db7d8c2d87 [GDExtension] Expose some low level functions and String operators. 2023-01-19 12:50:49 +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
207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +08:00
53c76fa5d1 [RTL/TextServer] Add baseline inline alignment mode for objects and RTL tables. 2022-12-15 23:16:02 +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
d77902f33a Implement SVG in OT support. 2022-11-04 14:10:54 +02:00
c1af9d57a3 Improve font glyph cache packing shelf best height fit heuristic. 2022-10-18 18:42:04 +03:00
8f5d56e04a [GDExtension] Use function names with underscore for TextServer extension, add macros to generate wrappers for module functions. 2022-09-28 10:04:11 +03:00
163257d51b [GDExtension] Implement support for typed arrays. 2022-09-22 23:31:27 +03:00
7adc8376ed Change Array arguments to TypedArray 2022-09-01 13:13:19 +02:00
7013c68619 Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0 2022-08-26 11:59:07 +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
366e2d893e [TextServer] Add a build warning when building with external FreeType without Brotli support. 2022-08-01 13:22:29 +03:00
c7255388e1 Remove ThreadWorkPool, replace by WorkerThreadPool
The former needs to be allocated once per usage. The later is shared for all threads, which is more efficient.
It can also be better debugged.
2022-07-25 15:39:50 +02:00