1
0
Fork 0
Commit Graph

29 Commits (c2c5dae760f13c35663030e0c92e0231ac90a86c)

Author SHA1 Message Date
Rubidium 0d902c9f5c Codefix: possible out-of-bounds array indexing 2025-03-10 07:09:49 +01:00
Peter Nelson 59680867c3 Codechange: Use structured bindings when iterating font_mapping. 2024-12-20 19:05:08 +00:00
Peter Nelson fe0afef36f
Codechange: Use unique_ptr instead of raw pointer for string layouts. (#13128) 2024-11-27 23:38:57 +00:00
Jonathan G Rennison 22b4a77e37
Codefix: Debug fmt strings in ItemizeBidi (ICU layout) (#12965) 2024-10-01 14:28:40 +01:00
Jonathan G Rennison a7d405b02d
Fix: ICUParagraphLayout line wrapping (#12956)
In the case where the overflow run is not the start run,
and the start run had a partial offset
2024-09-21 22:14:41 +01:00
Peter Nelson b56775f576
Codechange: Avoid making copies of intermediate layout runs. (#12796)
The vector of runs is not used after it is passed to the ParagraphLayout class, so pass with std::move to avoid an unnecessary copy.
2024-06-17 22:58:52 +01:00
Peter Nelson 5cd81a980e Codechange: Store both left and right glyph positions in a run.
This also allows the end of a run to be known without using an extra position entry.
2024-06-09 09:57:20 +01:00
Peter Nelson bbbf2b5282 Codechange: Return read-only span instead of vector from layout run functions. 2024-06-09 09:57:20 +01:00
Peter Nelson 3f5a354f37
Codechange: Use emplace with ICURun and UniscribeRun. (#12693) 2024-05-18 09:17:38 +01:00
Peter Nelson a1a01e21cf
Change: Use std::make_unique instead of passing new() (#12539) 2024-04-20 11:20:49 +01:00
ladysadie 727392e0b3
Codechange: Remove per font AA settings. (#12413)
OpenTTD will use the global AA font setting for all fonts from now on.
2024-04-15 21:44:33 +02:00
Peter Nelson 6d276698b6
Fix: Memory leak in ICUParagraphLayout::NextLine() (#11895)
This function calls icu::BreakIterator::createLineInstance() but does not clean up after it.

Instead use a static instance that is cloned (for thread-safety) and deleted as necessary.
2024-01-27 20:13:42 +00:00
Peter Nelson ae575a7a5b Codechange: Store text run positions in vector of points.
This simplifies the interlaced vector of x/y positions.
2024-01-19 00:08:31 +00:00
Peter Nelson f7cc88f370 Codechange: Return vector references instead of pointer to first item. 2024-01-19 00:08:31 +00:00
Patric Stout 2b599c9d00 Fix: [HarfBuzz] make HarfBuzz use the same glyphs as we render 2024-01-18 10:41:01 +01:00
Patric Stout a24c2bf10a Codechange: [HarfBuzz] hb-ft will set the scaling on its own 2024-01-18 10:41:01 +01:00
Michael Lutz 6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 2024-01-14 22:50:56 +01:00
Peter Nelson d4008850e3 Codechange: Ensure function opening `{` is on new line. 2023-11-09 20:15:38 +00:00
Rubidium 37f84b7372 Codechange: replace x.size() != 0 with !x.empty() 2023-10-20 23:05:43 +02:00
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 2023-10-20 23:05:43 +02:00
frosch 55da426d44 Codechange: All ParagraphLayoutFactory::AppendToBuffer assume that the buffer has at least some space.
Assert on that.
2023-09-19 22:49:59 +02:00
frosch 5733145c59 Cleanup: Remove unneeded parameters. 2023-09-19 22:49:59 +02:00
Jonathan G Rennison 9061fef59c
Fix #11203: [ICU] Glyph to char mapping with multiple runs (#11204) 2023-08-16 19:17:02 +00:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Patric Stout 0302e6f168
Codechange: initialize all values of ICURun on construction (#10892) 2023-05-30 19:17:30 +00:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Patric Stout aed36a609c
Fix: [ICU] crash when trying to break a non-breaking run (#10791)
Clusters from harfbuzz are indexed from the start of the buffer,
not from the start of the run analyzed. This confuses other parts
of the code that do assume they are from the start of the run.
2023-05-08 16:09:47 +00:00
Patric Stout 81d4fa6999 Feature: drop ICU-lx in favour of directly interfacing with harfbuzz
This means we have RTL support again with ICU 58+. It makes use of:
- ICU for bidi-itemization
- ICU for script-itemization
- OpenTTD for style-itemization
- harfbuzz for shaping
2023-05-01 22:17:56 +02:00
Patric Stout 9cb60768fe Codechange: split implementations of ParagraphLayouterFactory into their own file 2023-05-01 22:17:56 +02:00