sammycage / lunasvg

lunasvg is a standalone SVG rendering library in C++
MIT License
816 stars 115 forks source link

how to get the library version information #172

Open rossanoparis opened 2 weeks ago

rossanoparis commented 2 weeks ago

Perhaps I didn't look carefully, but I was not able to find a way to to get the library version information from source code.

sammycage commented 2 weeks ago

45 #170

sammycage commented 2 weeks ago

This feature has been added in the latest commit. Here's a concise example demonstrating the use of both LUNASVG_VERSION_STRING and LUNASVG_VERSION_ENCODE:

#include <iostream>
#include <lunasvg.h>

int main() {
    std::cout << "LunaSVG version: " << LUNASVG_VERSION_STRING << std::endl;
    if (LUNASVG_VERSION > LUNASVG_VERSION_ENCODE(2, 3, 0)) {
        std::cout << "Current version is newer than 2.3.0" << std::endl;
    }
    return 0;
}

This example prints the current version string and checks if the current version is newer than 2.3.0.