Skip to content

Releases: sammycage/plutovg

v1.3.0

22 Jul 17:10
Compare
Choose a tag to compare

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

14 Jul 09:23
Compare
Choose a tag to compare

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, and InterlockedCompareExchange are used for efficient, lock-free atomic operations on reference counts.
    • On C11-compliant platforms with <stdatomic.h>, atomic_fetch_add, atomic_fetch_sub, and atomic_load are used.
    • A fallback implementation using plain int is provided for platforms without atomic support (non-thread-safe).
  • Mutex Abstraction:

    • On Windows, CRITICAL_SECTION is used to implement recursive mutexes.
    • On C11 platforms with <threads.h>, mtx_t and mtx_recursive are used.
    • A no-op implementation is included for unsupported platforms, allowing builds to proceed without thread safety.

These changes lay the foundation for making plutovg safe to use in multi-threaded environments, improving robustness for concurrent applications.

v1.1.0

15 May 14:40
Compare
Choose a tag to compare
  • Enforce valid (0 < size < 32K) constraint on surface dimensions
  • Clip lines to clip_box using Cyrus-Beck to prevent infinite loops in gray_render_line
  • Generate plutovg.pc from cmake @dg0yt

Initial Major Release

11 Mar 09:59
Compare
Choose a tag to compare
  • Adopt Semantic Versioning (SemVer)
  • Add PLUTOVG_EMPTY_POINT and PLUTOVG_EMPTY_RECT macros

v0.0.13

27 Feb 03:26
Compare
Choose a tag to compare
  • Add plutovg_color_init_hsl and plutovg_color_init_hsla.
  • Support HSL/HSLA color syntax in plutovg_color_parse.

v0.0.12

31 Jan 12:08
Compare
Choose a tag to compare
  • Fix comma handling in SVG path and matrix parsing

v0.0.11

07 Jan 03:25
Compare
Choose a tag to compare
  • Fix endianness problems #43

v0.0.10

25 Dec 19:12
Compare
Choose a tag to compare
  • Fix incorrect font scaling
  • Prevent undefined behavior in memcpy by adding nullptr checks

v0.0.9

05 Nov 08:48
Compare
Choose a tag to compare
  • Enhanced Gradient Color Interpolation
  • Fixed Texture Tile Boundaries

v0.0.8

17 Oct 05:49
Compare
Choose a tag to compare
  • 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.