Releases: sammycage/lunasvg
v3.2.1
Support for textLength
and lengthAdjust
Attributes (#215)
This update now lets you control SVG text rendering with the textLength
and lengthAdjust
attributes. You can set a fixed width for your text and decide whether to tweak only the spacing between characters or to also stretch the glyphs.
We sincerely thank @terjehelgesen from Software Companions for their generous financial contribution, which helped make this feature possible!
v3.2.0
🚀 New Feature: Document::querySelectorAll()
querySelectorAll()
is a powerful way to select multiple elements from a Document
using CSS selectors. Unlike getElementById()
, which only fetches a single element by its ID, querySelectorAll()
allows you to retrieve multiple elements that match the given selector(s).
It works exactly like the JavaScript querySelectorAll()
method in the DOM:
👉 MDN Reference
📌 Example Usage
Consider an SVG with multiple <circle>
elements:
<svg width="200" height="200">
<circle cx="50" cy="50" r="40" fill="red" />
<circle cx="150" cy="50" r="40" fill="blue" />
</svg>
✔️ This selects all <circle>
elements and stores them in an ElementList
.
ElementList circles = document->querySelectorAll("circle");
Now, let's update all circles to green:
for (Element& circle : circles) {
circle.setAttribute("fill", "green");
}
✅ All circles turn green! 🎨
v3.1.1
🎄 LunaSVG v3.1.0
What's New
-
Dynamic Styling with CSS:
Introduced a newapplyStyleSheet
method for dynamic styling, making it easier to apply CSS styles to SVG content. See an example here. -
Automatic Layout Updates:
The library now detects document modifications and updates the layout automatically when necessary, eliminating the need for manualupdateLayout
calls. -
Enhanced Layout Control:
Added theforceLayout
method to trigger immediate layout updates when needed. -
Improved Text Rendering:
Support for CSS properties likebaseline-shift
,alignment-baseline
, anddominant-baseline
has been added, significantly enhancing text rendering capabilities.
Cheers to creating awesome things with these new features! Happy holidays and happy coding! 🎉
v3.0.1
LunaSVG v3.0
It has been over five months since I first announced the development of LunaSVG version 3.0, and today, I am beyond excited to finally share it with you! This journey has been filled with countless learning experiences, and while there’s still more work to be done, the library is now ready for use.
I want to express my deepest gratitude to all the LunaSVG users who took the time to test version 3.0 during its development. Your feedback, suggestions, and bug reports have been invaluable in shaping the final product, and I truly appreciate your efforts.
API Changes
The API for rendering and rasterization—the core of what LunaSVG is most often used for—remains mostly unchanged. However, there have been significant updates to the API for document manipulation. You can find the full API reference in the lunasvg.h
header file. I am also planning to release demos and examples soon, so stay tuned for that!
What’s New
A lot of work has gone into improving the core of LunaSVG. Much of the code has been rewritten to enhance quality and introduce exciting new features. I’ve also made it easier for LunaSVG to be integrated into other projects using CMake or Meson. Here’s a summary of what’s new:
- Support for text and image tags
- Meson build system support
- Modernized CMake
- Transition to C++17
- Introduction of plutovg as a dependency
- Improved document manipulation capabilities
Acknowledgments
None of this would have been possible without the incredible support of my donors. Your generosity allows me to dedicate more time to maintaining and improving my open-source projects, and I’m deeply thankful for your trust. I also want to extend a heartfelt thank you to everyone who contributed by submitting pull requests or detailed bug reports. Your help in reproducing and fixing issues made this process much smoother.
Thank you all for being part of this journey. I hope LunaSVG v3.0 serves you well!
v2.4.1
v2.4.0
What's Changed
- rename inner selector in seletor to subselector by @toge in #147
- Add SvgBooga to list of projects using LunaSVG by @etodanik in #148
- Add render child element by @lolpie244 in #162
New Contributors
- @toge made their first contribution in #147
- @etodanik made their first contribution in #148
- @lolpie244 made their first contribution in #162
Full Changelog: v2.3.9...v2.4.0
v2.3.9
v2.3.8
What's Changed
- Fix undefined behavior caused by a domain error on an sqrt call. by @m-carrasco in #123
- CMake modernization by @seanharmer in #84
- Fix for UB caused by wrong call to memcpy. by @m-carrasco in #125
- Fix for UB caused by null pointer arithmetic by @m-carrasco in #126
- Add missing cstdint include by @lemirep in #129
New Contributors
- @m-carrasco made their first contribution in #123
- @seanharmer made their first contribution in #84
- @lemirep made their first contribution in #129
Full Changelog: v2.3.5...v2.3.8