Commit graph

64 commits

Author SHA1 Message Date
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
bruvzg
e02a097280
[TextServer] Implement locale and context sensitive case conversion functions. 2022-01-17 14:23:36 +02:00
bruvzg
baec983d8a
[TextServer] Improvements for line breaking, "Fill" alignment, overrun, and interaction between these modes.
Fix "Fill" alignment processing wrong side of the text if overrun trim was applied.
Improve "Fill" alignment to avoid adding excessive subsequent spaces or elongations.
Add font detection to the overrun, to correctly add ellipsis (was using last glyph font, which doesn't necessary have dot character).
Improve line breaking to avoid adding excessive subsequent soft break points for languages without word separator.
Port missing overrun/justification code to the Fallback text server.
Fix inferred text direction detection by controls.
Add tests for "Fill" alignment and line breaking glyph flags.
2022-01-13 08:53:28 +02:00
bruvzg
c89c515ccf
[TextServer] Improve ligature cursor handling.
Fix mid-grapheme hit test.
Fix OpenType features property handling, add default features override option.
Enable mid-grapheme cursor by default.
2022-01-09 19:03:48 +02:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Rémi Verschelde
88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
Rémi Verschelde
5968653662
Merge pull request #46721 from bruvzg/custom_word_break_punct 2021-11-09 00:13:59 +01:00
bruvzg
3f33e1d7d6 Add functions for getting name and font style from dynamic and bitmap fonts.
Add font selection toolbar editor plugin.
2021-10-31 12:40:58 +02:00