Exposes the path separation as a public function so callers
using the draw funcs directly can separate glyph outlines.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove draw svg_prefix from New API list and sections.txt
- Document pen_x/pen_y removal, dedup removal, _glyph
simplification in the Vector library section
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add hb_vector_draw_set_{foreground,background}() and getters.
SVG: foreground wraps body in <g fill="rgb(...)">; background
emits a <rect> covering the viewBox before content.
PDF: foreground sets fill color via rg operator before glyph
content; background emits a filled rect at the start of the
content stream.
Default: foreground opaque black, background transparent.
Wire both into the hb-vector CLI util alongside the paint
equivalents. Remove the old util-side emit_background_rect.
Regenerated vector test expected outputs.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add hb_vector_paint_set_background() / get_background() and
hb_raster_paint_set_background() / get_background().
For vector: if set to a non-transparent color, the SVG renderer
emits a <rect> covering the viewBox before glyph content, and
the PDF renderer prepends a filled rectangle to the content
stream. Both support semi-transparent backgrounds (SVG via
fill-opacity, PDF via ExtGState /ca).
For raster: the root surface is pre-filled with the background
color before glyph compositing begins.
Default is transparent (no background emitted).
The hb-vector CLI util wires --background to the new API.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The six public draw / paint funcs getters across raster,
vector, and gpu used to be singletons:
hb_raster_draw_get_funcs (void)
hb_raster_paint_get_funcs (void)
hb_vector_draw_get_funcs (void)
hb_vector_paint_get_funcs (void)
hb_gpu_draw_get_funcs (void)
hb_gpu_paint_get_funcs (void)
That works fine for raster and gpu, where there's a single
backend per type, but breaks for the vector backend where
SVG and PDF have separate funcs sets — callers using the
public getter always got SVG funcs and silently produced
SVG markup inside PDF output streams when invoking the new
arbitrary-path clip API on a PDF context.
Make all six take a const-pointer to the relevant context
instance. vector_paint dispatches on paint->format; the
other five just use the instance for symmetry today (room
for future format-style dispatch later).
Also expose hb_vector_draw_get_format / hb_vector_paint_
get_format public getters so callers (or third parties)
can ask a vector context for its format without poking at
internals.
Also: hb_vector_paint_push_clip_path_end now wraps the
emitted SVG clipPath's path in transform="scale(1,-1)" so
free-form arbitrary clips at base body level land in the
same coord system the per-glyph <use scale(_,-sy)>
wrappers establish. Without this, free-form clip-path
arbitrary outlines emitted between paint_glyph calls came
out mirrored across the X axis.
Updates internal callers (hb_vector_paint_glyph,
hb_pdf_emit_glyph_path, hb_raster_paint_push_clip_path_
start, hb_gpu_paint_push_clip_path_start, the GPU pen
adapter), util sites (raster-output.hh, vector-output.hh,
gpu/demo-font.cc), API tests (test-raster.cc, test-gpu.cc),
and the docs section index.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
API rename for the not-yet-released stroked/filled
rectangle helper added to hb-draw — full names
(hb_draw_line, hb_draw_circle, hb_draw_rectangle) read
better than mixed full/abbreviated.
Updates the public header, impl, the gpu doc reference,
the GPU API test, the GPU demo's extents overlay, the
extents-overlay paint helper, and the docs section
listing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add push_clip_path_start / push_clip_path_end to the
hb_paint_funcs_t vtable, for callers that want to clip paint
output to an arbitrary shape (not just a glyph or rectangle).
hb_draw_funcs_t *df = hb_paint_push_clip_path_start (pf, pd, &dd);
hb_draw_move_to (df, dd, NULL, ...);
hb_draw_line_to (df, dd, NULL, ...);
...
hb_draw_close_path (df, dd, NULL);
hb_paint_push_clip_path_end (pf, pd);
/* paint ops here are clipped to the emitted path */
hb_paint_pop_clip (pf, pd);
The backend hands back a draw_funcs + draw_data pair (transfer
none) that accumulates the clip path; end() signals the
caller is done drawing clip geometry and the accumulated
path becomes an active clip. pop_clip closes the scope,
symmetric with push_clip_glyph / push_clip_rectangle.
Only public API and the nil vtable stubs land here. Backend
implementations (hb-vector, hb-raster, hb-gpu) follow in
separate commits.
Partial: https://github.com/harfbuzz/harfbuzz/issues/5930
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every COLRv1 renderer ends up rewriting these three helpers;
they now live on hb-paint.h so Skia, FreeType-SVG, and other
downstream paint-API implementers can consume a single
canonical implementation.
* hb_paint_reduce_linear_anchors() -- 3-anchor (P0, P1, P2)
to 2-point axis projection.
* hb_paint_normalize_color_line() -- sort + rescale stops
to [0, 1]; returns (min, max) so callers can shift
gradient geometry to match.
* hb_paint_sweep_gradient_tiles() + matching
hb_paint_sweep_gradient_tile_func_t callback typedef --
iterates the full 0..2π sweep produced by a color-stop
list, invoking the callback once per (start, end)
angular segment. Handles PAD / REPEAT / REFLECT.
Implementation moves from src/hb-paint.hh (private, static
inline) to src/hb-paint.cc (public, HB_EXTERN). The sweep
tiler loses its C++ template/lambda flavor and grows a
user_data parameter alongside the function-pointer callback;
the three in-tree callers (cairo, vector-paint, vector-paint-pdf)
now use standalone trampoline functions + context structs
instead of captured lambdas.
Fixes: https://github.com/harfbuzz/harfbuzz/issues/5928
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidate the {vector,raster,gpu}_{draw,paint}_glyph APIs
to match the hb_font_{draw,paint}_glyph / _or_fail pattern:
* Each existing *_glyph() public function now returns void.
For the draw variants this is purely a return-value drop.
For the paint variants the void entry additionally gains a
synthesize fallback for non-color glyphs (calls
hb_font_paint_glyph instead of _or_fail) so a mono glyph
still produces output via a foreground-colored outline.
* New *_glyph_or_fail() variants return hb_bool_t, reporting
exactly what hb_font_{draw,paint}_glyph_or_fail() would.
Callers that care about distinguishing color paint from
synthesized outline now have a clean boolean signal.
Refactors the internal impls behind a shared static helper
parameterised by a `fallible` flag; the two public entries
delegate, passing true (for _or_fail) or false (for the void
alias).
For GPU specifically, paint_glyph_or_fail no longer folds the
encoder's unsupported flag into its return -- that state was
always better reported from hb_gpu_paint_encode() (which
returns NULL), and conflating the two prevented callers from
telling "font has no paint data" from "encoder hit a limit".
While in there, remove a dead branch at the end of
hb_vector_paint_glyph's SVG case (both inner blocks had
already returned; the tail was unreachable).
Updates docs/harfbuzz-sections.txt with the six new symbols
and the NEWS note with the Changed API callouts. Updates
in-tree callers (hb-vector-svg-all, hb-raster-all, test-gpu,
util/vector-output.hh) to the _or_fail variants where they
previously read the return value.
Fixes: https://github.com/harfbuzz/harfbuzz/issues/5926
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [gpu] Add hb_gpu_draw_line / _rect / _circle shape helpers
The GPU draw encoder already consumes arbitrary curves via the
hb_draw_funcs_t machinery -- that's how glyph outlines feed in.
Expose three convenience helpers so callers can emit common
shapes (tapered line, rectangle, circle) without having to
hand-roll the curve math:
hb_gpu_draw_line (draw, x0,y0,w0, x1,y1,w1);
hb_gpu_draw_rect (draw, x,y,w,h, stroke_width);
hb_gpu_draw_circle (draw, cx,cy,r, stroke_width);
stroke_width = NaN means "filled". A finite positive value
produces a stroked outline by emitting an outer contour CCW
and an inner contour CW so the fill rule carves a hole.
For shapes beyond these three helpers, callers can feed any
outline through hb_draw_move_to / _line_to / _quadratic_to /
_cubic_to / _close_path with the funcs from
hb_gpu_draw_get_funcs() and the hb_gpu_draw_t as data -- the
helpers are thin wrappers over that path.
Useful for game UI: health bars, progress rings, custom
line-art decorations, rendered through the same slug shader
as text.
Assisted-by: Claude <noreply@anthropic.com>
* [util/gpu] Add --show-extents flag
Exercises hb_gpu_draw_rect: when the flag is set, each glyph
blob encodes its ink-extent frame as an extra stroked
rectangle alongside the glyph outline, so the frame is cached
with the glyph and renders with no extra draw call.
The frame is padded outward by stroke_width / 2 so the stroke
sits entirely outside the glyph ink (otherwise the inner half
would knock out against the glyph shape, since both fill in
the same blob).
Cmdline-only for now -- a runtime 'e' toggle would require a
buffer re-shape hook that native hb-gpu doesn't yet expose.
Assisted-by: Claude <noreply@anthropic.com>
* [util/gpu] Cmdline toggles mirroring interactive keybindings
Add --dark / --no-vsync / --fullscreen / --no-stem-darken /
--debug so scripts and CI can start hb-gpu in any of the
states previously reachable only by pressing a key
interactively. Applied via the same keystroke path by
synthesizing the corresponding key characters through
demo_view_type() at startup -- single source of truth for
each toggle.
Assisted-by: Claude <noreply@anthropic.com>
* [draw] Promote shape helpers from hb-gpu-draw to hb-draw
Three shape-emitting helpers (line, rect, circle) operate on
any hb_draw_funcs_t, not specifically the GPU backend. Move
them out of the GPU-only API surface into the core hb-draw
API so any pen (raster, vector, gpu, user-supplied) gets
them.
API rename / move:
hb_gpu_draw_line -> hb_draw_line (in src/hb-draw.h)
hb_gpu_draw_rect -> hb_draw_rect
hb_gpu_draw_circle -> hb_draw_circle
Signatures gain a (dfuncs, draw_data, st) prefix to match the
existing hb_draw_move_to / line_to / cubic_to / close_path
shape -- the helpers are thin wrappers over those.
Callers in test/api/test-gpu.cc and util/gpu/demo-font.cc
updated to call hb_draw_* with hb_gpu_draw_get_funcs() and a
local hb_draw_state_t.
Updated harfbuzz-sections.txt with the new entries; removed
hb_gpu_draw_line / _rect / _circle from hb-gpu.h.
Assisted-by: Claude <noreply@anthropic.com>
* [draw] hb_draw_line: NaN second width defaults to first
Common case is a uniform-width line. Letting @w1 default to
@w0 when NaN is passed makes the call shorter:
hb_draw_line (..., x0, y0, 4, x1, y1, NAN); /* uniform 4 */
Mirrors the NaN-as-sentinel convention used in hb_draw_rect /
hb_draw_circle for the stroke_width parameter.
Assisted-by: Claude <noreply@anthropic.com>
* [draw] hb_draw_line: add cap parameter (butt / square)
Add hb_draw_line_cap_t enum with HB_DRAW_LINE_CAP_BUTT (the
existing default behavior) and HB_DRAW_LINE_CAP_SQUARE, which
extends each endpoint along the line direction by half its
local stroke width.
Square caps let four hb_draw_line() calls form a closed
rectangle without gaps at the corners -- a meaningfully
cheaper alternative to hb_draw_rect() for thin outlined
rectangles, since each line's bbox is just stroke_width tall
instead of covering the full rectangle interior.
Round caps not implemented yet; can be added as a third enum
value when a use case shows up.
Assisted-by: Claude <noreply@anthropic.com>
Verb-then-thing matches the rest of the hb-vector setter/getter
naming (set_precision, set_palette, etc.). Update the renamed
internal references and the NEWS / harfbuzz-sections.txt entries
to match.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Flat mode disabled glyph reuse / caching to produce inline-
everything SVG output. Its main use case was making
hb-vector SVGs safe to concatenate side-by-side in a single
document, but the recently-added svg_set_prefix API solves
that without giving up the cache. No remaining callers in
tree (util/vector-output.hh's --flat option goes too).
Removes:
- hb_vector_draw_set_flat / get_flat
- hb_vector_paint_set_flat / get_flat
- the `flat` field on both contexts
- all `if (flat)` / `bool can_cache = !flat` branches
- the --flat option in util/vector-output.hh
- the four "flat*" expected files in test/vector/basic
- the flat_draw / flat_paint params in the vector fuzzer
- sections-list entries
meson test --no-rebuild green (241/241).
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The integration chapter explained how to use hb-glib /
hb-ft / hb-cairo / hb-uniscribe / hb-coretext / hb-icu but
never linked to the actual symbol pages. Readers had to
guess the docbook page name to find the function reference.
Add a "API reference: <link>" line at the top of each of
the five C-binding integration sections (Python intentionally
omitted -- uharfbuzz lives outside this manual).
doc-check is green.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a "Single-file build with harfbuzz-world.cc" section
right after the configuration knob list. Names the
amalgamation file, references the HB_TINY / HB_HAS_*
machinery the section above just covered, and points at
the harfbuzz-world.cc playground + source as a worked
example.
doc-check is green.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New public API for namespacing SVG output: callers that embed
multiple hb-vector-produced SVGs into the same document can
set a distinct id prefix per context, so hb-vector's short
internal IDs (p<N>, c<N>, clip-g<N>, gr<N>, cg<N>) don't
collide across snippets.
Example collision the new API prevents: page embeds two
hb-vector SVGs produced by different contexts. Both use
id="clip-g10"; the browser's url(#clip-g10) resolves to
whichever element appears first, so paint layers in the
second SVG get clipped against the first SVG's glyph outline
-- visible as giant unclipped color rects bleeding across
the wrong glyph shape.
With the new API the second caller passes e.g. "b-" as its
prefix; the clash disappears. Empty/NULL prefix preserves
the existing output byte-for-byte.
Affects every id / url(#...) / href="#..." emission in SVG
output:
- hb-vector-draw: <path id="p..."> + <use href="#p...">
- hb-vector-paint: <path>, <clipPath>, <linearGradient>,
<radialGradient>, <g id="cg..."> color-glyph cache, and
every corresponding url(#...) / href="#..." ref.
PDF output is unaffected (no ids).
Docs/harfbuzz-sections.txt updated; check-symbols passes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add hb_draw_line_cap_t enum with HB_DRAW_LINE_CAP_BUTT (the
existing default behavior) and HB_DRAW_LINE_CAP_SQUARE, which
extends each endpoint along the line direction by half its
local stroke width.
Square caps let four hb_draw_line() calls form a closed
rectangle without gaps at the corners -- a meaningfully
cheaper alternative to hb_draw_rect() for thin outlined
rectangles, since each line's bbox is just stroke_width tall
instead of covering the full rectangle interior.
Round caps not implemented yet; can be added as a third enum
value when a use case shows up.
Assisted-by: Claude <noreply@anthropic.com>
Three shape-emitting helpers (line, rect, circle) operate on
any hb_draw_funcs_t, not specifically the GPU backend. Move
them out of the GPU-only API surface into the core hb-draw
API so any pen (raster, vector, gpu, user-supplied) gets
them.
API rename / move:
hb_gpu_draw_line -> hb_draw_line (in src/hb-draw.h)
hb_gpu_draw_rect -> hb_draw_rect
hb_gpu_draw_circle -> hb_draw_circle
Signatures gain a (dfuncs, draw_data, st) prefix to match the
existing hb_draw_move_to / line_to / cubic_to / close_path
shape -- the helpers are thin wrappers over those.
Callers in test/api/test-gpu.cc and util/gpu/demo-font.cc
updated to call hb_draw_* with hb_gpu_draw_get_funcs() and a
local hb_draw_state_t.
Updated harfbuzz-sections.txt with the new entries; removed
hb_gpu_draw_line / _rect / _circle from hb-gpu.h.
Assisted-by: Claude <noreply@anthropic.com>
Mirror the draw API. hb_gpu_paint_t already had x_scale / y_scale
fields and hb_gpu_paint_glyph() set them directly, but no public
setter / getter -- callers that want to use the paint funcs
without going through paint_glyph had no way to wire the scale.
Add the public setters / getters and route paint_glyph through
them, matching hb_gpu_draw_glyph's pattern. Document on both
draw and paint that the convenience wrappers call _set_scale.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a raster-style configuration surface to hb_gpu_paint_t:
hb_gpu_paint_set_foreground / hb_gpu_paint_get_foreground
hb_gpu_paint_set_palette / hb_gpu_paint_get_palette
hb_gpu_paint_clear_custom_palette_colors
hb_gpu_paint_set_custom_palette_color
hb_gpu_paint_glyph now passes paint->palette and paint->foreground
through to hb_font_paint_glyph, and the custom-palette-color
callback consults the user's overrides map (same pattern as
hb_raster_paint_t) before letting harfbuzz fall back to the font's
own palette.
With that in place, the color() callback can bake the already-
resolved RGBA into the encoded op directly, quantized as signed
Q15 in the existing second texel, instead of recording a palette
index and trusting the shader to look it up. The is_foreground
flag stays in the op so a runtime foreground-color change (e.g.
dark-mode toggle) still works without re-encoding.
Shader side: drop the hb_gpu_palette uniform/storage binding and
its HB_GPU_PALETTE_SIZE knob from all four paint-fragment shaders
(GLSL / MSL / WGSL / HLSL); read the per-layer color straight out
of the blob texel. This removes a per-backend binding slot and
the 256-entry uniform-array size ceiling that blocked fonts like
Noto-COLRv1 (~6200 entries).
Trade-off: changing the palette selection or overrides invalidates
previously encoded blobs and requires re-encoding. In practice
palette switches are rare, and the rendering hot path gets
simpler.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wire the paint-callback pipeline for COLRv0 color glyphs.
Adds:
* push_clip_glyph / pop_clip / color / custom_palette_color
callbacks. Each COLRv0 layer's push_clip_glyph is captured,
then the following color callback rasterizes the clip-glyph
outline through a scratch hb_gpu_draw_t, appends the resulting
Slug sub-blob, and emits a LAYER_SOLID op carrying the
palette_index (preserved via custom_palette_color) plus the
is_foreground flag. pop_clip clears the pending state.
* hb_gpu_paint_get_funcs(): cached singleton hb_paint_funcs_t via
the standard hb_paint_funcs_lazy_loader_t.
* hb_gpu_paint_glyph(): stashes the font scale and invokes
hb_font_paint_glyph_or_fail() with our funcs and a sentinel
foreground (the encoder never stores foreground -- the shader
resolves it per quad from a caller-supplied attribute).
* hb_gpu_paint_encode(): concatenates the 3-texel header, the op
stream, and the collected sub-blobs into one RGBA16I blob,
patching each op's sub_blob-index into an absolute texel
offset. Returns NULL when no layers accumulated or an
unsupported (v1) feature was seen.
* hb_gpu_paint_clear(): discards ops, sub-blobs, and pending
state while preserving the font scale.
The gradient / group / transform callbacks are not wired yet, so
COLRv1 paint graphs silently fall through -- callers should
precheck with hb_ot_color_glyph_has_paint() and route v1 glyphs
elsewhere (or fall back to draw).
Enables HB_NO_COLOR and HB_NO_PAINT in the web demo config
override so the wasm link resolves the new paint pipeline
symbols. Measured on a local Emscripten build:
raw wasm: 412722 -> 437752 (+25030 B, +6.1%)
gzip wasm: 170342 -> 179165 ( +8823 B, +5.2%)
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reserve the paint-encoder API shape and wire the demo to try the
paint path before falling back to draw. The encoder itself is
still a stub so the fallback always fires today; when the encoder
lands, color glyphs will flip automatically with no demo changes.
New public API:
hb_gpu_paint_glyph (paint, font, glyph)
Stashes the font scale on @paint and calls
hb_font_paint_glyph_or_fail() with hb_paint_funcs_get_empty()
so non-color glyphs report false. Returns the funcs call
result.
hb_gpu_paint_encode (paint, &extents)
Stub, returns NULL.
hb_gpu_paint_clear (paint)
hb_gpu_paint_reset (paint)
hb_gpu_paint_recycle_blob (paint, blob)
Stubs that preserve the right semantics. clear is a no-op
(no accumulator state yet), reset additionally zeroes the
stashed scale, recycle_blob hb_blob_destroys.
Adds x_scale / y_scale to hb_gpu_paint_t so glyph can stash them
for the encoder to consume later.
util/gpu/demo-font.cc:
- Creates a paired hb_gpu_paint_t alongside hb_gpu_draw_t.
- Per glyph: if the face has COLRv1 paint for the glyph, tries
hb_gpu_paint_glyph + hb_gpu_paint_encode. On NULL blob, falls
through to the existing draw path.
- Changes the per-iteration sync from _reset to _clear for both
draw and paint: _reset zeroes the font-scale config that
_glyph immediately re-populates, which wastes work and is
semantically wrong. _clear discards accumulator state while
preserving user config.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reserve the API shape for the upcoming GPU color-glyph paint
encoder. The skeleton adds:
hb_gpu_paint_t opaque type
hb_gpu_paint_create_or_fail ()
hb_gpu_paint_reference ()
hb_gpu_paint_destroy ()
hb_gpu_paint_set_user_data () / _get_user_data ()
hb_gpu_paint_shader_source (stage, lang)
Only the lifecycle is functional. hb_gpu_paint_shader_source()
returns an empty string for all supported (stage, lang) pairs
until the paint-renderer shaders land.
This commit wires up the files, public declarations, section
index, and build system (meson, CMake, harfbuzz-world.cc,
vtable). Callers can now hold, reference, destroy, and attach
user data to a paint context.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The draw-renderer fragment shaders defined utilities
(HB_GPU_UNITS_PER_EM, the hb_gpu_atlas uniform, hb_gpu_fetch) that
any future GPU renderer will also need. The draw-renderer vertex
shader likewise contained only the generic hb_gpu_dilate helper.
If a paint renderer were added today and a caller linked both
fragment sources together, hb_gpu_fetch would be defined twice.
Move these shared helpers into a new family of sources and expose
them via a new public entry point:
hb_gpu_shader_source (stage, lang);
The existing hb_gpu_draw_shader_source() now returns only the
draw-specific fragment code; it returns an empty string for the
vertex stage because all current vertex logic is shared. Callers
concatenate the shared source first, then the draw-specific
source, then their own main():
[#version, hb_gpu_shader_source (...), hb_gpu_draw_shader_source
(...), main]
Additions:
- src/hb-gpu-fragment.{glsl,msl,wgsl,hlsl} — shared fragment
- src/hb-gpu-vertex.{glsl,msl,wgsl,hlsl} — shared vertex,
renamed from hb-gpu-draw-vertex.*
- src/hb-gpu-shaders.cc — hb_gpu_shader_source() dispatcher
Removals:
- src/hb-gpu-draw-vertex.{glsl,msl,wgsl,hlsl} — moved to common
Shared sources are Behdad-only copyright; the Eric Lengyel / Slug
attribution stays on the draw-specific fragment sources where the
Slug algorithm actually lives.
Updates: test/api/test-gpu.cc, the Metal/D3D11/WebGPU/GL demo
shaders, the hb-gpu SECTION documentation, meson.build,
CMakeLists.txt, gen-gpu-shader-artifacts.py decl_map,
harfbuzz-world.cc, and docs/harfbuzz-sections.txt.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the eight new getters introduced in the recent API-cleanup
commits to their section indexes:
hb_raster_paint_get_foreground
hb_raster_paint_set_palette
hb_raster_paint_get_palette
hb_vector_draw_get_flat
hb_vector_draw_get_precision
hb_vector_paint_get_foreground
hb_vector_paint_get_palette
hb_vector_paint_get_flat
hb_vector_paint_get_precision
Without these entries gtk-doc's doc-check flags the new symbols
as undocumented.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the two separate getters
hb_gpu_shader_fragment_source (lang)
hb_gpu_shader_vertex_source (lang)
with a single
hb_gpu_draw_shader_source (stage, lang)
where stage is the new hb_gpu_shader_stage_t enum (VERTEX or
FRAGMENT). Parameter order is stage-first because "the vertex
shader in GLSL" reads more naturally than the reverse, and stage
is the primary axis (it determines which shader object the source
is compiled into).
The `_draw_` in the new name makes room for the incoming
hb_gpu_paint_shader_source() once the COLRv1 encoder lands —
that family will have its own (likely different) shader sources
per stage and language.
Updated the four in-tree callers: test/api/test-gpu.cc, and the
GPU demos under util/gpu/. ABI break on a 14.0-only API; the
gpu library is still young enough that this is acceptable.
Marked new API with XSince: REPLACEME.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hb_gpu_draw_set_scale() existed without a paired getter; all other
draw/paint contexts have get/set pairs. Fill the gap for symmetry.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bring hb_gpu_draw_encode into line with the rest of the render APIs:
auto-clear on success, and return the computed glyph extents to the
caller via a new out-parameter (nullable).
HB_EXTERN hb_blob_t *
hb_gpu_draw_encode (hb_gpu_draw_t *draw,
hb_glyph_extents_t *extents);
Consumers typically need both the encoded blob and the glyph's
extents to size the quad they'll draw into in the vertex shader;
returning them together removes a redundant trip through the draw
state and lets encode() auto-clear like hb_vector_*_render() and
hb_raster_*_render() do.
Drop hb_gpu_draw_get_extents() from the public API — its only
role was reading extents out of the draw state post-encode, which
the new encode() signature makes redundant. The computation
stays (moved to a static _hb_gpu_draw_get_extents helper) so
encode() can call it before auto-clear wipes the state.
ABI break for anyone who had already wired up against the 14.0.0
hb_gpu_draw_encode signature or hb_gpu_draw_get_extents, but the
library is new/experimental and the two in-tree consumers
(test/api/test-gpu.cc, util/gpu/demo-font.cc, util/hb-gpu-encode-all.cc,
test/fuzzing/hb-gpu-fuzzer.cc) are updated here.
All 240 tests pass.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follow-up to the _clear() API additions — add the five new public
symbols to the generated-docs section index so gtk-doc picks them up.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Default hb_vector_{draw,paint}_t::format to HB_VECTOR_FORMAT_INVALID
instead of HB_VECTOR_FORMAT_SVG.
- Update renamed hb_vector_{draw,paint}_set_{flat,precision} API docs
from "Since: 13.0.0" to "XSince: REPLACEME".
- Extract hb_vector_draw_render_svg() helper to match the
hb_vector_draw_render_pdf() pattern; move the misplaced
hb_vector_draw_render doc comment to the actual function and update
it to say "output blob" since the renderer is no longer SVG-only.
- Revert 14.0.0 NEWS entry edits; the API rename will be announced in
the next release entry.
- Update docs/harfbuzz-sections.txt to reflect the API renames.
- hb-vector tool: expose -O/--output-format with supported formats
"svg/pdf", validate format, update description string, and switch
PDF detection to g_ascii_strcasecmp for case-insensitive matching.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a new push_group variant that receives the compositing mode
upfront. This lets backends like PDF emit blend-mode state before
painting the group content, avoiding the need to buffer and
retroactively wrap.
The default (nil) implementation calls hb_paint_push_group(), so
existing backends are unaffected.
Callers updated:
- COLR PaintComposite now calls push_group_for() for both groups
- Rust/fontations push_layer passes the mode through
- hb-raster SVG context accepts mode parameter (default SRC_OVER)
All 233 tests pass.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show subset, raster, vector, GPU logos inline at 64px
next to the main HarfBuzz logo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Change hb_gpu_shader_{fragment,vertex}_sources() (array + count)
to hb_gpu_shader_{fragment,vertex}_source() returning a single
const char *. Each language variant is one complete string.
Simplifies the demo shader compilation and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>