Releases: sammycage/plutovg
v1.3.2
What's Changed
- plutovgConfig.cmake.in: add Threads find_dependency by @luadebug in #66
- Build fixes by @biodranik in #67
- Fixed duplicated macro warning for enabled Unity builds by @biodranik in #68
- Fix assert on haiku by passing valid args to mtx_init. by @memecode in #69
New Contributors
- @luadebug made their first contribution in #66
- @biodranik made their first contribution in #67
- @memecode made their first contribution in #69
Full Changelog: v1.3.1...v1.3.2
v1.3.1
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, andInterlockedCompareExchangeare used for efficient, lock-free atomic operations on reference counts. - On C11-compliant platforms with
<stdatomic.h>,atomic_fetch_add,atomic_fetch_sub, andatomic_loadare used. - A fallback implementation using plain
intis provided for platforms without atomic support (non-thread-safe).
- On Windows (
-
Mutex Abstraction:
- On Windows,
CRITICAL_SECTIONis used to implement recursive mutexes. - On C11 platforms with
<threads.h>,mtx_tandmtx_recursiveare 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_POINTandPLUTOVG_EMPTY_RECTmacros