Commit Graph
20869 Commits
Author SHA1 Message Date
Behdad EsfahbodandClaude Opus 4.6 fddaba2132 [docs] Add design philosophy to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:17:51 -06:00
Behdad EsfahbodandClaude Opus 4.6 541ed9ab3f [docs] Add NEWS entry for 14.0.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:13:37 -06:00
Behdad EsfahbodandClaude Opus 4.6 0d2131a52b [docs] Simplify hinting note in README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:08:26 -06:00
Behdad EsfahbodandClaude Opus 4.6 df92bdb395 [docs] Add Overview section to README
Quick reference map of libraries, integration backends,
amalgamated sources, and command-line tools for integrators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:07:48 -06:00
Behdad EsfahbodandClaude Opus 4.6 14effc302a [gpu] Add hb_gpu_darken() to all shader languages
Library function for stem darkening: pow(2, brightness-0.5)
scaled by ppem. Added to GLSL, MSL, WGSL, HLSL with consistent
brief docs. Demo shaders now call the library function.
Section docs in hb-gpu.cc updated with usage example.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:49:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 f99f91a658 [gpu] Update Metal stem darkening to pow(2, brightness-0.5)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:26:51 -06:00
Behdad EsfahbodandClaude Opus 4.6 9e2828622c [gpu] Use pow(2, brightness-0.5) for stem darkening
Replace boolean light_on_dark with continuous brightness-driven
exponent. pow(2, b-0.5) gives sqrt(2)≈1.414 for white text
(thin) and 1/sqrt(2)≈0.707 for black text (fatten), perfectly
symmetric around 1.0 at 50% gray.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:25:31 -06:00
Behdad EsfahbodandClaude Opus 4.6 b9e864e9e7 [gpu] Link to live web demo from API docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:04:07 -06:00
Behdad Esfahbod 9e0d8d48c4 Revert "Revert "[webgpu] Align touch handoff with WebGL fixes""
This restores commit 00a3475ce.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 18:40:40 -06:00
Behdad Esfahbod a7367b65e2 Revert "[webgpu] Align touch handoff with WebGL fixes"
This reverts commit 00a3475ce.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 18:39:20 -06:00
Behdad Esfahbod 00a3475ce0 [webgpu] Align touch handoff with WebGL fixes
The WebGPU touch path was still using the older gesture state machine.
It handled 3->2 reseeding, but it did not track whether a pinch was
active and it had no explicit 2->1 single-finger pan handoff.

Carry over the proven transition rules from the WebGL path without
changing desktop input handling: track pinch-active and synthetic
single-pan state, preserve the 3->2 reseed, and continue pan after a
pinch when one finger remains. touchcancel now also clears those touch
states consistently.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 18:36:54 -06:00
Behdad Esfahbod 2c15cb9123 [web] Continue pan after pinch handoff
The previous fix stopped the 2->1 jump by swallowing the pinch-ending
touchend and seeding a synthetic left-button press at the remaining
finger. But subsequent one-finger motion was still left to the browser,
which does not reliably resume mouse emulation mid-gesture.

Track an explicit single-finger pan mode after the pinch handoff, route
its touchmove events to synthetic mousemove, and end it with a
gesture-cancelled synthetic mouseup on lift or touchcancel.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 18:25:42 -06:00
Behdad Esfahbod 7c3c313bbc [web] Fix pinch to single-finger handoff
The WebGL touch path only tracked the initial 3->2 reseed with
skipNextPinchMove. Once a real pinch was underway, the later 2->1
transition stopped being treated as a gesture handoff and fell back
into the browser/GLFW single-touch path.

Track pinch-active state explicitly, swallow the pinch-ending touchend,
and hand single-finger pan off from the remaining touch by syncing the
cursor before synthesizing mousedown. This keeps the 3->2->1 sequence
from jumping the view when the second finger lifts.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 18:22:03 -06:00
Behdad Esfahbod 4ebb454061 Revert "[gpu] Sync cursor position on 2→1 touch transition"
This reverts commit d44b0958fa.
2026-03-30 18:18:15 -06:00
Behdad EsfahbodandClaude Opus 4.6 d44b0958fa [gpu] Sync cursor position on 2→1 touch transition
Dispatch mousemove before mousedown when transitioning from
pinch to single-finger pan, so GLFW's cursor position matches
the remaining finger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:17:34 -06:00
Behdad Esfahbod 3d18a8e0c8 Merge pull request #5884 from harfbuzz/docs-ci
[gpu] Dedicated docs + web demo CI workflow
2026-03-30 18:06:42 -06:00
Behdad EsfahbodandClaude Opus 4.6 d4c659eca1 [gpu] Add help2man to docs CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:49:45 -06:00
Behdad EsfahbodandClaude Opus 4.6 1612415265 [gpu] Disable chafa in docs CI
Not needed for docs/web demo build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:49:27 -06:00
Behdad EsfahbodandClaude Opus 4.6 8bc79a6beb [gpu] Dedicated docs + web demo CI workflow
Move docs generation and deployment from linux.yml to a new
docs.yml workflow. The new workflow also:
- Installs Emscripten
- Builds WebGL and WebGPU web demos
- Copies demo output to docs/html/hb-gpu-demo/
- Deploys everything to harfbuzz.github.io on tagged releases

Web demos will be available at harfbuzz.github.io/hb-gpu-demo/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:41:38 -06:00
Behdad Esfahbod 2e4da9e9ad Merge remote-tracking branch 'origin/main' 2026-03-30 17:39:47 -06:00
Behdad EsfahbodandClaude Opus 4.6 a6f4eb546f [gpu] Disable gpu_demo in Rust CI, remove unneeded deps
Rust CI only tests Rust integration, no need for GLEW/GLFW.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:37:06 -06:00
Behdad Esfahbod 812fabac63 Merge pull request #5883 from harfbuzz/gpu-ci
Build hb-gpu demo on mingw CI
2026-03-30 17:34:43 -06:00
Behdad Esfahbod 5955ab5198 [docs] Add favicon for generated docs
The generated gtk-doc site only shipped the existing logo assets, so
harfbuzz.github.io had no root favicon for browsers to discover.

Add a small 64x64 favicon.ico derived from the existing docs logo
and install it as a gtk-doc HTML asset so the Pages deployment
copies it to the site root.

Testing:
- meson test -C build

Assisted-by: OpenAI Codex
2026-03-30 16:58:23 -06:00
Behdad EsfahbodandClaude Opus 4.6 21cd96db3f [gpu] Disable gpu_demo in msys2 CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:46:16 -06:00
Behdad EsfahbodandClaude Opus 4.6 c8838ea8f7 [gpu] Disable gpu_demo in msys2 CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:45:22 -06:00
Behdad EsfahbodandKhaled Hosny 7af550edd4 Update util/gpu/meson.build
Co-authored-by: Khaled Hosny <khaled@aliftype.com>
2026-03-30 16:40:29 -06:00
Behdad EsfahbodandClaude Opus 4.6 a06e913734 [gpu] Drop redundant -Dgpu=enabled from MinGW cross-build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:31:05 -06:00
Behdad EsfahbodandClaude Opus 4.6 3cb68ee048 [gpu] Enable gpu_demo in MinGW cross-build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:29:58 -06:00
Behdad EsfahbodandClaude Opus 4.6 a6396882b0 [gpu] Add gpu_demo option, disable on MSVC only
GPU library always builds (no deps). GPU demo controlled by
gpu_demo option (auto default). Only MSVC CI disables it
(GLEW wrap broken with -nodefaultlib). All other CIs install
GLEW/GLFW system packages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:09:37 -06:00
Behdad EsfahbodandClaude Opus 4.6 f138460772 [gpu] Simplify GPU demo dep handling across CIs
Drop gpu_demo option. GLEW/GLFW use required:false — demo builds
when deps are found, skipped when not. Install GLEW/GLFW on all
CIs (Linux already had them, add to macOS and Rust). MinGW CI
uses wraps via --wrap-mode=default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:02:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 d30dc93503 [gpu] Add gpu_demo option, gate deps behind it
GPU library is always built (no deps). GPU demo (hb-gpu) requires
GLEW/GLFW/GL and is controlled by gpu_demo option (auto by default).
When disabled, deps aren't even looked up — fixes MSVC pulling in
broken GLEW wrap. MinGW CI explicitly enables with -Dgpu_demo=enabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:55:06 -06:00
Behdad EsfahbodandClaude Opus 4.6 16b1068543 [gpu] Change GPU option default from enabled to auto
Prevents MSVC builds from pulling in GLEW wrap which fails
with -nodefaultlib (missing memset). MinGW CI explicitly
passes -Dgpu=enabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:52:21 -06:00
Behdad EsfahbodandClaude Opus 4.6 ee9340cf4b [gpu] Use meson wraps for GLFW and GLEW
Replace manual CI download/install with meson WrapDB subprojects.
Meson automatically downloads and builds them when system deps
aren't found (--wrap-mode=default).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:44:14 -06:00
Behdad EsfahbodandClaude Opus 4.6 acb8cf7b88 [gpu] Fix CI: build GLEW from source, remove Ubuntu package dep
Ubuntu doesn't have libglew-mingw-w64-dev. Download GLEW source
and build with MinGW instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:36:29 -06:00
Behdad EsfahbodandClaude Opus 4.6 4d17c40bff [gpu] Move GLFW install from build-win.sh to CI workflow
build-win.sh assumes deps are present (like other deps).
The workflow downloads GLFW prebuilt binaries and installs
into the MinGW sysroot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:32:06 -06:00
Behdad EsfahbodandClaude Opus 4.6 5f5dec6e99 [gpu] Wire D3D11 into CI cross-build
- Add --direct3d flag to hb-gpu via gpu-output.hh
- Download GLFW prebuilt for MinGW in build-win.sh
- Add libglew-mingw-w64-dev to CI packages
- Enable -Dgpu=enabled in cross-build
- hb-gpu.exe ships in the Windows zip with D3D11 support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:27:33 -06:00
Behdad EsfahbodandClaude Opus 4.6 9b3a62ca84 [gpu] Integrate D3D11 renderer into main hb-gpu tool
Wire demo_renderer_create_d3d11 into gpu-output.hh with --direct3d
flag. Add to meson build conditionally on Windows with d3d11 and
d3dcompiler libraries. Remove standalone D3D11 demo (superseded).

hb-gpu.exe --demo --direct3d now works under Wine.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:19:28 -06:00
Behdad EsfahbodandClaude Opus 4.6 5aaef7d43a [gpu] Fix M_PI for MinGW cross-compilation
Add _USE_MATH_DEFINES before <cmath> includes on Windows.
hb-gpu.exe now cross-compiles successfully with MinGW.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:13:37 -06:00
Behdad EsfahbodandClaude Opus 4.6 67c8529825 [gpu] Add D3D11 renderer for the main hb-gpu tool (Windows)
Implements demo_renderer_t using D3D11, same pattern as Metal.
Uses GLFW for windowing (GLFW_NO_API + glfwGetWin32Window).
Compiled conditionally with #ifdef _WIN32.

Not yet wired into gpu-output.hh or build system — needs
GLFW and GLib for MinGW, which are available on Fedora.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:02:35 -06:00
Behdad EsfahbodandClaude Opus 4.6 5cd2461db9 [gpu] Rename hb-gpu-demo to hb-gpu, make installable
The tool now requires a font file argument by default, like
other hb-* tools. Pass --demo to use the built-in demo font
and text. --metal is now a proper GLib option instead of manual
argv parsing. Window title changed to "HarfBuzz GPU".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 14:55:53 -06:00
Behdad Esfahbod f776a25657 Revert "[gpu] Add trail mode (p key)"
This reverts commit 17bdcac84f.
2026-03-30 13:48:32 -06:00
Behdad Esfahbod 32e6eea763 Revert "[gpu] Add exponential fade to trail mode"
This reverts commit fa576c3a6e.
2026-03-30 13:48:11 -06:00
Behdad EsfahbodandClaude Opus 4.6 fa576c3a6e [gpu] Add exponential fade to trail mode
Draw a semi-transparent fullscreen quad with the background color
each frame instead of clearing, so previous frames fade gradually.
Uses a tiny passthrough shader and attributeless triangle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:45:44 -06:00
Behdad EsfahbodandClaude Opus 4.6 17bdcac84f [gpu] Add trail mode (p key)
Skip glClear when trail is on — previous frames stay visible,
creating a paint/stamp effect during animation and interaction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:42:41 -06:00
Behdad EsfahbodandClaude Opus 4.6 1c242329dc [gpu] Double-click reset on both left and right buttons
Double-left-click and double-right-click both reset view.
Middle-click reset also still works. Updated help text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:55:19 -06:00
Behdad EsfahbodandClaude Opus 4.6 bbc0b5b682 [gpu] Double-click to reset view
Second click within 300ms undoes the first click's animation
toggle and resets the view. Works across all backends.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:48:55 -06:00
Behdad EsfahbodandClaude Opus 4.6 453eb77634 [gpu] Fix pan after pinch: synthesize mousedown on 2→1 transition
GLFW doesn't see the remaining finger after a swallowed pinch,
so synthesize a mousedown to start drag tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:42:59 -06:00
Behdad Esfahbod db6d2c27ec Revert "[web] Move tap recognition to touchend"
This reverts commit 7db69c0cd0.
2026-03-30 12:32:50 -06:00
Behdad Esfahbod 7db69c0cd0 [web] Move tap recognition to touchend
WebGL mobile currently commits a tap on touchstart, then the second
tap in a double-tap zoom has to undo that animation toggle. This
makes tap and double-tap drag compete and can start animation before
gesture intent is clear.

Track a pending single tap until touchend, suppress the synthetic
click toggle on release, and only fire the animation toggle after the
double-tap timeout expires. A second tap now cancels that pending
toggle and claims double-tap zoom directly.

Testing:
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- source /home/behdad/emsdk/emsdk_env.sh >/dev/null &&
  EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 12:31:24 -06:00
Behdad Esfahbod 9ddc43a2b5 [gpu] Revert pinch jitter deadzone
The deadzone suppressed slow, deliberate pinch rotation too
aggressively. Restore the original pinch sensitivity.

Testing:
- EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build.sh
- EM_CACHE=/tmp/emscripten-cache ./util/gpu/web/build-webgpu.sh

Assisted-by: OpenAI Codex
2026-03-30 12:22:10 -06:00