Releases: sammycage/plutovg
v1.3.0
Advanced Font Cache and Region Testing
This release adds a powerful font-face cache system and new APIs for testing whether a point lies within fill, stroke, or clip regions. It improves font management, enables dynamic font selection by family and style, and supports precise hit-testing for interactive graphics.
New APIs and Features
Font-Face Cache System
A complete API for managing and accessing font faces:
-
Creation and Lifecycle
plutovg_font_face_cache_create()
plutovg_font_face_cache_reference()
plutovg_font_face_cache_destroy()
plutovg_font_face_cache_reference_count()
plutovg_font_face_cache_reset()
-
Manual Addition and Retrieval
plutovg_font_face_cache_add()
Adds a font face with a specified family and style.plutovg_font_face_cache_add_file()
Loads and adds a font face from a specific file.plutovg_font_face_cache_get()
Retrieves a font face matching a given style.
-
Bulk Font Loading
plutovg_font_face_cache_load_file()
Loads all faces from a single file.plutovg_font_face_cache_load_dir()
Recursively loads fonts from a directory.plutovg_font_face_cache_load_sys()
Loads system-installed fonts.
Canvas Font Integration
The canvas can now associate and select fonts dynamically using:
-
plutovg_canvas_set_font_face_cache()
Assigns a font cache to the canvas. -
plutovg_canvas_get_font_face_cache()
Retrieves the current cache from the canvas. -
plutovg_canvas_add_font_face()
Registers a font face under a family and style. -
plutovg_canvas_add_font_file()
Loads and registers a font face from a file. -
plutovg_canvas_select_font_face()
Selects a font face for use in drawing operations.
These APIs allow high-level font selection using family names and style flags (bold
, italic
), while internally managing font-face lifetimes through the cache.
Point Containment Queries
Three new functions provide hit-testing against rendering regions in user space:
-
plutovg_canvas_fill_contains()
Tests whether a point lies within the current fill region (ignores clip and surface). -
plutovg_canvas_stroke_contains()
Tests whether a point lies within the stroked path outline. -
plutovg_canvas_clip_contains()
Tests whether a point lies inside the canvas clipping region.
These APIs allow precise user interaction handling, including mouse hit-tests and visual region queries.
v1.2.0
Make plutovg Thread-Safe with Atomic Ops and Mutexes
This release introduces platform-specific implementations of atomic reference counting and mutex primitives, making plutovg
objects thread-safe across supported systems.
Key Additions:
-
Atomic Reference Counting:
- On Windows (
_WIN32
),InterlockedIncrement
,InterlockedDecrement
, andInterlockedCompareExchange
are used for efficient, lock-free atomic operations on reference counts. - On C11-compliant platforms with
<stdatomic.h>
,atomic_fetch_add
,atomic_fetch_sub
, andatomic_load
are used. - A fallback implementation using plain
int
is provided for platforms without atomic support (non-thread-safe).
- On Windows (
-
Mutex Abstraction:
- On Windows,
CRITICAL_SECTION
is used to implement recursive mutexes. - On C11 platforms with
<threads.h>
,mtx_t
andmtx_recursive
are used. - A no-op implementation is included for unsupported platforms, allowing builds to proceed without thread safety.
- On Windows,
These changes lay the foundation for making plutovg
safe to use in multi-threaded environments, improving robustness for concurrent applications.
v1.1.0
Initial Major Release
- Adopt Semantic Versioning (SemVer)
- Add
PLUTOVG_EMPTY_POINT
andPLUTOVG_EMPTY_RECT
macros
v0.0.13
v0.0.12
v0.0.11
v0.0.10
v0.0.9
v0.0.8
-
Implemented all compositing modes:
Clear
Source
Destination
Source Over
Destination Over
Source In
Destination In
Source Out
Destination Out
Source Atop
Destination Atop
XOR
-
Resolved issues related to undefined behavior in the RadialGradient functionality.
-
Fixed issues related to incomplete stroke rendering.