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>
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>
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>