Commit graph

72 commits

Author SHA1 Message Date
bruvzg 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
bruvzg 27f6f4147b
[TextServer] Expose ICU title case string conversion to scripting. 2024-04-04 10:56:49 +03:00
Rémi Verschelde 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
bruvzg 433de7f1a8
[RTL] Use "visible characters" property for inline object visibility 2024-03-12 11:28:45 +02:00
bruvzg 911fa38d3a
[Font] Add option to disable embedded bitmaps loading. 2024-03-11 16:31:10 +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
Aaron Franke 91b24b2780
Use GODOT_MODULE define in TextServer modules 2024-01-06 01:19:29 -06:00
bruvzg 56579f397d
[Text Overrun] Add option to set custom ellipsis character, add support for system font fallback. 2023-12-04 08:21:42 +02:00
bruvzg 9a1e0e4aef
[Bitmap fonts] Add support for scaling. 2023-10-13 12:57:45 +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
bruvzg 5453503697
[Text Server] Store extra spacing of individual font variations. 2023-08-24 11:58:12 +03:00
bruvzg 5d3fcc5766
[TextServer] Fix system font fallback and caret/selection behavior for composite characters. 2023-08-15 11:42:40 +03:00
Hendrik Brucker 7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
Rémi Verschelde 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
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
Rémi Verschelde 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
bruvzg 8459aeaab0
[Font] Implement get_char_from_glyph_index function. 2023-03-01 09:29:11 +02:00
bruvzg bbc77b6d29
Fix text server GDExtension build. 2023-02-26 18:38:22 +02:00
bruvzg c950a1ab94
[TextServer] Add mutex for FreeType face creation/deletion operations. 2023-02-26 17:55:04 +02:00
bruvzg db7d8c2d87
[GDExtension] Expose some low level functions and String operators. 2023-01-19 12:50:49 +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
Haoyu Qiu 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
bruvzg 53c76fa5d1
[RTL/TextServer] Add baseline inline alignment mode for objects and RTL tables. 2022-12-15 23:16:02 +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
bruvzg d77902f33a
Implement SVG in OT support. 2022-11-04 14:10:54 +02:00
bruvzg c1af9d57a3
Improve font glyph cache packing shelf best height fit heuristic. 2022-10-18 18:42:04 +03:00
bruvzg 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
bruvzg 163257d51b
[GDExtension] Implement support for typed arrays. 2022-09-22 23:31:27 +03:00
kobewi 7adc8376ed Change Array arguments to TypedArray 2022-09-01 13:13:19 +02:00
Rémi Verschelde 7013c68619
Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0 2022-08-26 11:59:07 +02:00
bruvzg bcc3643989
Add font LCD sub-pixel anti-aliasing support. 2022-08-23 08:47:21 +03:00
kobewi 8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
bruvzg 366e2d893e
[TextServer] Add a build warning when building with external FreeType without Brotli support. 2022-08-01 13:22:29 +03:00
Juan Linietsky 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
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
bruvzg 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
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
Rémi Verschelde 632b933a03
Merge pull request #61934 from Geometror/hashfuncs
Hash function improvements
2022-06-15 07:34:43 +02:00
Hendrik Brucker 8c61470fa9 Hash function improvements 2022-06-15 00:32:10 +02:00
bruvzg 6e4cdad3ac
[TextServer] Adds support for TrueType / OpenType collection files (*.TTC, *.OTC). 2022-06-07 11:35:59 +03:00
bruvzg b3bbf3db47
[GDExtension] Expose Variant, NodePath and StringName hash functions. 2022-06-06 12:19:56 +03:00
bruvzg 6783d55ce4
Use new HashMap implementation in the TextServer, and Font. 2022-05-12 13:42:25 +03:00
bruvzg 6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
bruvzg be611c1c05
Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +03:00
bruvzg aad9d1414c
Delay font texture update, until draw is called. Rasterize glyphs during shaping. 2022-04-05 10:49:41 +03:00
bruvzg f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
bruvzg b32e8d63d8
Add options to embolden and transform font outlines to simulate bold and italic typefaces. 2022-03-11 14:02:30 +02:00
bruvzg 29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
bruvzg 215bede6ff
[TextServer] Add function to change font, font size, and OpenType features without invalidating line break points, justification points, or recreating shaped text buffer. 2022-02-02 11:20:44 +02:00