Commit Graph
71 Commits
Author SHA1 Message Date
Behdad Esfahbod 25fc94439a Merge pull request #5733 from skef/depend-draft-pr
OpenType font dependency graph support
2026-07-30 11:12:48 -06:00
Behdad Esfahbod 37015a2326 [util] Inhibit help2man usage on crossbuilds 2026-06-07 23:39:25 +02:00
Skef IterumandClaude Sonnet 4.6 2c28850a55 [depend] Add util/hb-subset-depend print utility; fix flags field initialization
Add uninstalled util/hb-subset-depend that prints the glyph dependency
graph for a font. Supports filtering by GID range (--gids), showing only
flagged edges (--flagged), suppressing context output (--no-context), and
using numeric IDs instead of glyph names (--no-glyph-names). Registered
in util/meson.build under experimental_api + subset guards.

Also fix a bug in hb_subset_depend_lookup_glyph where the flags field of
hb_subset_depend_entry_t (a 4-byte enum) was written via a uint8_t*,
leaving the upper 3 bytes uninitialized. Use a local uint8_t variable and
assign it properly to entries[i].flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 15:09:12 -07: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 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 EsfahbodandClaude Opus 4.6 f3be5f329b [gpu] Inline demo shaders as raw string literals
Replace separate .glsl files and generated .hh headers with C++11
raw string literals (R"glsl(...)glsl") directly in demo-shader.cc.
Matches the pattern already used by demo-metal.mm and the WebGPU
demo. Removes demo shader generation from meson and the generator
script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:02:00 -06:00
Behdad EsfahbodandClaude Opus 4.6 ddd6a86470 [gpu] Add debug heatmap mode (d key)
Refactor library fragment shaders (GLSL, MSL, WGSL) to extract
_hb_gpu_decode_glyph and _hb_gpu_curve_counts helpers, used by
both hb_gpu_render and the debug visualization.

Debug mode (d key) shows per-pixel curve counts as a heatmap:
R = horizontal band curves, G = vertical band curves, B = text
coverage. Scale 0-8 curves maps to 0-1 intensity.

Also auto-generates demo shader headers via meson, and adds
set_debug to the renderer interface.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:40:38 -06:00
Behdad EsfahbodandClaude Opus 4.6 6910b9a3ed [gpu] Add Metal backend for macOS demo
Add MSL shader translations of the Slug GPU text rasterizer, and a
Metal rendering backend for hb-gpu-demo selectable via --metal flag.

Library changes:
- Add HB_GPU_SHADER_LANG_MSL enum value
- Add hb-gpu-vertex.msl and hb-gpu-fragment.msl
- Extend gen-gpu-shader-artifacts.py for MSL

Demo changes:
- Add demo-metal.h/mm with CAMetalLayer rendering
- Add external atlas backend for non-GL paths
- Add demo_buffer_get_vertices for Metal draw path
- Skip GL init when using Metal (GLFW_NO_API)
- Add --metal command-line flag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 13:36:28 -06:00
Behdad EsfahbodandClaude Opus 4.6 0172453697 [gpu] Remove unused gpu_demo_generated from meson
The demo headers are pre-generated and committed; the
custom_target generation was already removed but the empty
variable and its reference remained.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 01:46:29 -06:00
Behdad EsfahbodandClaude Opus 4.6 25e69d9b96 [gpu] Port hb-gpu-demo to options.hh infrastructure
Replace the manual getopt-based demo main with the standard
main_font_text_t / shape_consumer_t composition, getting all
harfbuzz options for free: --variations, --features, --script,
--direction, --face-index, --font-funcs, etc.

New gpu_output_t (in util/gpu-output.hh) implements the output
interface, feeding shaped glyphs to the demo's GL renderer.

Add demo_buffer_add_glyph() and demo_buffer_current_line() to
demo-buffer for glyph-at-a-time insertion (vs the old batch
add_text which did its own shaping).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:34:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 198dc300d0 [gpu] Add hb-gpu-encode-all utility
Encodes all glyphs in a font, reports failures and summary
statistics (encoded/empty/failed counts, total and average sizes).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:19:04 -06:00
Behdad EsfahbodandClaude Opus 4.6 4c78e3bf67 [gpu] Rename demo binary to hb-gpu-demo
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:21:12 -06:00
Behdad EsfahbodandClaude Opus 4.6 e8d2bddfab [gpu] Make GL deps optional; add them to Linux CI
The demo requires GLEW, GLFW3, and GL. Make these optional so the
library still builds on headless systems. The demo is skipped when
they're missing.

Install the GL packages in the Linux CI workflow so the demo
builds there.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:14:10 -06:00
Behdad EsfahbodandClaude Opus 4.6 9732ad4bcf [gpu] Build hb-gpu binary in util/ instead of util/gpu/
Move the executable definition to util/meson.build so the binary
lands at util/hb-gpu, consistent with other utilities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:50:41 -06:00
Behdad EsfahbodandClaude Opus 4.6 03c2688436 [gpu] Add GPU demo app in util/gpu
Port the glyphy-demo to use the hb-gpu API.  Builds as util/hb-gpu
and requires GLEW, GLFW3, and OpenGL 3.3.  Includes default text
and embedded font for quick testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:30:13 -06:00
Jan Alexander Steffens (heftig) 2bf4ba5f26 util: Add missing chafa_dep to hb-raster 2026-03-11 14:16:51 +02:00
Khaled Hosny 1ccd8e5395 [util] Install hb-raster 2026-03-07 22:19:06 +02:00
Khaled Hosny b91d4b8d75 Add meson options to disable building harfbuzz-subset 2026-03-04 18:12:45 +02:00
Khaled Hosny 72ee0c2dfd Add meson options to disable building harfbuzz-vector 2026-03-04 18:12:45 +02:00
Khaled Hosny 9520926168 Add meson options to disable building harfbuzz-raster 2026-03-04 18:12:45 +02:00
Behdad Esfahbod 0692853d7d [util] Split hb-draw-all and hb-vector-svg-all 2026-02-24 12:53:49 -03:00
Behdad Esfahbod 6653d62480 [test/util] Rename draw suite and tools to vector 2026-02-24 10:17:18 -03:00
Behdad Esfahbod 3c099ee71c Add initial libharfbuzz-vector SVG backend and utility rename 2026-02-24 08:52:34 -03:00
Behdad Esfahbod afee4ee43b util: add hb-ft-raster-all 2026-02-21 20:22:48 -03:00
Behdad EsfahbodandClaude Opus 4.6 c34428cea2 util: guard hb-ft-raster build on HAVE_FREETYPE
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-21 17:29:05 -03:00
Behdad EsfahbodandClaude Opus 4.6 3bed6db1d9 Move hb-draw-all, hb-paint-all, hb-raster-all to util/ as uninstalled binaries
Move perf tools from perf/ and test/raster/ to util/ alongside the
other uninstalled utilities.  Remove the now-empty test/raster/ directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-21 17:29:05 -03:00
Behdad EsfahbodandClaude Opus 4.6 d92bfc4ca5 util: add hb-ft-raster tool for pixel-level comparison
Same shaping/positioning pipeline as hb-raster but uses FreeType's
rasterizer (FT_Outline_Render) instead of hb_raster.  Useful for
comparing coverage values between the two rasterizers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-21 17:29:05 -03:00
Behdad EsfahbodandClaude Sonnet 4.6 08b76f5db1 hb-raster: add util/hb-raster tool
Renders shaped text into a single auto-sized A8 PGM raster image,
written to stdout or --output-file.  Mirrors util/hb-draw in structure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 17:29:05 -03:00
Behdad Esfahbod 821b375331 Fix build without help2man 2026-02-19 12:14:33 -03:00
أحمد المحمودي d151372473 Create man pages with useful whatis entry (#5521) 2026-02-19 04:43:04 -07:00
Behdad Esfahbod e9573900e1 [util] Add initial hb-draw implementation 2026-02-12 15:26:19 -07:00
Behdad Esfahbod 68c7cfff43 [util] Don't specify helper-subset.hh (#5473)
Not needed I believe.
2025-08-17 16:57:32 -06:00
Behdad Esfahbod d47a47e20b [util] Make --help less verbose again
Just the main page gets env-vars, exit-codes, and see-also.
2025-03-27 13:59:08 -06:00
Khaled Hosny 7ab42f9af3 [util] Build man pages only if docs are enabled 2025-03-27 21:31:29 +02:00
Khaled Hosny 9609f50bad [util] Build man page only if the corresponding util is built 2025-03-27 21:31:29 +02:00
Khaled Hosny 9a80c0da84 [util] Install man pages 2025-03-27 21:16:12 +02:00
Behdad Esfahbod 7f10c0edfd [util] Towards building manpages
TODO:
1. Only when docs are enabled?
2. Installdir
3. How to include in release?

Fixes https://github.com/harfbuzz/harfbuzz/issues/5208
2025-03-26 22:21:51 -06:00
Behdad Esfahbod 2b5f244639 [util] Remove hb-ot-shape-closure
Not used...
2025-03-25 14:12:36 -06:00
Behdad Esfahbod 395270e494 [fontations] Try folding into libharfbuzz 2025-03-06 04:23:24 +02:00
Behdad Esfahbod f28daba53c [fontations] I don't know... 2025-03-06 04:23:24 +02:00
Behdad Esfahbod 161b20f333 Try building with cargo 2025-03-06 04:23:24 +02:00
Behdad Esfahbod f9b4706151 [fontations] Use as dependency, not library
Since it's optional.
2025-03-06 04:23:24 +02:00
Behdad Esfahbod 2abe54fc9c Almost works! 2025-03-06 04:23:24 +02:00
Garret Rieger d30c1dacf5 Add test suite for instancing option parsing. 2023-11-15 20:16:07 +00:00
Behdad Esfahbod 7a29ded169 [hb-info] Render colors in --list-palette
Uses chafa if available
2023-01-24 16:59:44 -07:00
Khaled Hosny 1cf61f3053 [meson] Fix build with -Dgobject=disabled 2023-01-23 16:26:35 +02:00
Khaled Hosny eba5762919 Another try 2023-01-22 16:30:34 -07:00
Khaled Hosny 37ab12a372 [util] Try to fix hb-info build 2023-01-22 16:30:34 -07:00
Behdad Esfahbod 4ec3d2e32a [hb-info List enum nicks in --list-names 2023-01-22 14:13:52 -07:00
Behdad Esfahbod ca903f7531 [hb-info] Start adding 2023-01-19 12:40:27 -07:00