Commit Graph

131 Commits

Author SHA1 Message Date
fbcb98855d Fix MSDF fonts color modulation. 2022-08-30 20:28:53 +03:00
7013c68619 Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0 2022-08-26 11:59:07 +02:00
62c3e72b6f Merge pull request #63959 from KoBeWi/typo_arrray
Replace Array return types with TypedArray (part 1)
2022-08-23 08:52:13 +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
1c5a50fac6 Fix color modulation of the grayscale glyphs in font with mixed color / grayscale data. 2022-08-22 21:01:22 +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
80c9a44492 Fix overrun flag check and HarfBuzz safe to break flag check. 2022-08-04 22:58:28 +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
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
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
344ba0ffaf Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
b5c96df277 Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +03:00
632b933a03 Merge pull request #61934 from Geometror/hashfuncs
Hash function improvements
2022-06-15 07:34:43 +02:00
8c61470fa9 Hash function improvements 2022-06-15 00:32:10 +02:00
6e4cdad3ac [TextServer] Adds support for TrueType / OpenType collection files (*.TTC, *.OTC). 2022-06-07 11:35:59 +03:00
cfcdfc38e2 [RTL] Add support for shaping in background thread. 2022-05-19 09:34:44 +03:00
05963674a7 Implement TextMesh resource.
Apply simulated slant and embolden to the TextServer `gont_get_glyph_contours` results.
2022-05-13 08:20:22 +03:00
6783d55ce4 Use new HashMap implementation in the TextServer, and Font. 2022-05-12 13:42:25 +03:00
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
68304bec47 [TextServer] Fix incorrect oversampled font scaling. 2022-05-10 13:57:18 +03:00
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
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
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
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
aad9d1414c Delay font texture update, until draw is called. Rasterize glyphs during shaping. 2022-04-05 10:49:41 +03:00
b78aa4fe19 Style: Apply clang-tidy to current code, add readability-redundant-member-init 2022-04-04 21:49:51 +02:00
f19cd44346 Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
d9f8cadafb Improve simulated bold fonts advance. 2022-03-13 15:07:53 +02:00
b32e8d63d8 Add options to embolden and transform font outlines to simulate bold and italic typefaces. 2022-03-11 14:02:30 +02:00
29199579f7 Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
244db37508 Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
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
8a0a3accee simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
e02a097280 [TextServer] Implement locale and context sensitive case conversion functions. 2022-01-17 14:23:36 +02:00
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
7faf02383c Merge pull request #55225 from bruvzg/fix_ligature_cursor_and_ot_features 2022-01-10 13:32:54 +01:00
af6758e008 Fix freezes when tab is zero or negative width. 2022-01-10 12:19:29 +02:00
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
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
01bac2c469 [Text Server] Fix re-shaping of substrings, improve oversampling scale. 2021-12-15 11:57:22 +02:00
41a20171eb align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
ae713f8980 Add a minimal template build to CI
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-11-12 09:30:50 -06:00
88c4380737 Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
5968653662 Merge pull request #46721 from bruvzg/custom_word_break_punct 2021-11-09 00:13:59 +01:00
d9a74fd07f Merge pull request #54372 from bruvzg/text_edit_ui 2021-11-09 00:13:25 +01:00
4052d85d05 Repaired mistyped of 'threshold' on several files. 2021-10-31 22:11:42 +07:00
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
ebbc25e89c Ignore empty Font resources as theme override.
Add range hint to font_size properties.
Remove excessive `base_size` Font property.
2021-10-25 14:05:37 +03:00