Commit Graph
8 Commits
Author SHA1 Message Date
Behdad Esfahbod 07fe5d55a6 [directwrite] Avoid implicit double promotion
The RTL-safe offset is intentionally double precision, while the font
scale is a float. Cast the scale explicitly before multiplying so GCC's
-Wdouble-promotion does not warn about the intended conversion.

Testing: MinGW DirectWrite build with -Wdouble-promotion
Testing: meson test -C build --print-errorlogs

Assisted-by: Codex <codex@openai.com>
2026-08-18 04:28:08 -06:00
Behdad Esfahbod c91e0cace0 Merge pull request #6162 from harfbuzz/fix-directwrite-libstdcxx
[directwrite] Avoid C++ allocation runtime
2026-08-17 15:13:59 -06:00
Behdad Esfahbod 7e444d887a [directwrite] Avoid C++ allocation runtime
DirectWrite used scalar and array new/delete for its COM helpers and
shaping buffers. This left operator new/delete references in MinGW
static and amalgamated builds, forcing C consumers to link libstdc++.

Use HarfBuzz allocators and containers instead, propagate allocation
failures from text analysis, and let Meson use the normal C linker.

Tested with MinGW Meson and CMake DirectWrite builds, a C-linked
amalgamation, and the full Meson test suite.

Fixes: https://github.com/harfbuzz/harfbuzz/issues/6160
Assisted-by: OpenAI Codex <codex@openai.com>
2026-08-13 19:32:24 -06:00
Behdad Esfahbod 8c67f8315b [directwrite] Clamp shaped positions
DirectWrite returns floating-point advances and offsets which were
stored and scaled through unchecked integer conversions. Clamp the
scratch values and final scaled positions, and negate RTL offsets in
floating point.

This is part of the complete position-overflow fix for issue #6151.

Testing: meson test -C build --print-errorlogs

Assisted-by: Codex <codex@openai.com>
2026-08-12 18:06:27 -06:00
Behdad Esfahbod ba709a385e [dwrite] Fix cast-align error-warning
Fixes https://github.com/harfbuzz/harfbuzz/issues/5197
2025-03-24 02:08:04 -06:00
Behdad Esfahbod 91bd6bf0df [directwrite] Make variations work on font-funcs 2025-03-22 16:38:56 -06:00
Khaled Hosny 686503e2e0 [directwrite] Copy font variations when shaping 2025-03-20 01:59:56 +02:00
Behdad Esfahbod db8d099d4d [dwrite] Split shape code into its own file 2025-03-15 13:59:16 -06:00