{"id":33939397,"url":"https://github.com/nickbrowne/nsvg","last_synced_at":"2026-04-09T00:02:05.711Z","repository":{"id":57646236,"uuid":"113177302","full_name":"nickbrowne/nsvg","owner":"nickbrowne","description":"A simple Rust interface around NanoSVG","archived":false,"fork":false,"pushed_at":"2022-11-01T17:19:25.000Z","size":95,"stargazers_count":23,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T06:05:49.916Z","etag":null,"topics":["nanosvg","rust","svg","vector"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/nsvg","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickbrowne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-05T12:07:26.000Z","updated_at":"2025-03-11T19:19:25.000Z","dependencies_parsed_at":"2022-09-26T20:22:17.294Z","dependency_job_id":null,"html_url":"https://github.com/nickbrowne/nsvg","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nickbrowne/nsvg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickbrowne%2Fnsvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickbrowne%2Fnsvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickbrowne%2Fnsvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickbrowne%2Fnsvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickbrowne","download_url":"https://codeload.github.com/nickbrowne/nsvg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickbrowne%2Fnsvg/sbom","scorecard":{"id":684892,"data":{"date":"2025-08-11","repo":{"name":"github.com/nickbrowne/nsvg","commit":"fa9b0ba8ba8ae55ed81896fedc4efec7cf657dff"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T00:28:15.468Z","repository_id":57646236,"created_at":"2025-08-22T00:28:15.468Z","updated_at":"2025-08-22T00:28:15.468Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nanosvg","rust","svg","vector"],"created_at":"2025-12-12T15:27:15.142Z","updated_at":"2026-04-09T00:02:05.696Z","avatar_url":"https://github.com/nickbrowne.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nsvg [![Build Status](https://travis-ci.org/nickbrowne/nsvg.svg?branch=master)](https://travis-ci.org/nickbrowne/nsvg) [![Build status](https://ci.appveyor.com/api/projects/status/nr4jsaibmh5i3fxw/branch/master?svg=true)](https://ci.appveyor.com/project/nickbrowne/nsvg/branch/master) [![Crates.io](https://img.shields.io/crates/v/nsvg.svg)](https://crates.io/crates/nsvg)\n\nA friendly Rust wrapper around the excellent NanoSVG C library.\n\nOffers a simple way to parse and rasterize SVG, at whichever scale you want. It was written as a convenient way to have scaled UI elements in video games that are suited to the user's selected resolution, but can also be used for simple file conversions.\n\nNanoSVG supports a wide range of SVG features, with most of the vector elements fully supported.\n\nThe rasterizer runs entirely on the CPU and has no external dependencies. The quality will be fairly equivalent to exporting a bitmap from Inkscape. The rasterizer is based on the one in `stb_truetype`, all rasters will be anti-aliased. You can read more about it [here](https://nothings.org/gamedev/rasterize/).\n\nThere are faster GPU based solutions to rendering vector graphics out there, but the simplicity of NanoSVG and it's lack of dependencies is a huge benefit, and should run just fine cross platform.\n\n## Usage\n\nInclude `nsvg` in your `Cargo.toml` dependencies.\n\n```toml\n[dependencies]\nnsvg = \"0.5.1\"\n```\n\nTo include `nsvg` without the `image` dependency, add it to your `Cargo.toml` without default dependencies.\n\n```toml\n[dependencies.nsvg]\nversion = \"0.5.1\"\ndefault-features = false\n```\n\nNow you can parse and rasterize SVGs. Use the scale argument to produce larger or smaller rasterised images. The aspect ratio will always remain the same.\n\n\n```rust\nextern crate nsvg;\n\nuse std::path::Path;\n\nfn main() {\n  let path = Path::new(\"examples/example.svg\");\n\n  // Load and parse the svg\n  let svg = nsvg::parse_file(path, nsvg::Units::Pixel, 96.0).unwrap();\n\n  // Create a scaled raster\n  let scale = 2.0;\n  let image = svg.rasterize(scale);\n}\n\n```\n\n## Unsupported SVG elements\n\nAs it is mostly intended to be used for parsing and rasterizing vector graphics, some SVG features are not supported by nsvg:\n\n - Text elements are ignored, although text can simply be converted to a path and it will work just fine\n\n - Embedded bitmap images are ignored\n\n - Scripts are ignored\n\n - Animations are ignored\n\nIf you encounter anything that does not rasterize as you would expect, try converting it to a path first.\n\n## Developing\n\nBy default nsvg will use prebuilt FFI bindings, but you can regenerate them manually by running:\n\n```\ncargo build --features bindgen\n```\n\nWhich will also copy the bindings into the `src` directory. If the bindings need to be updated (when upgrading NanoSVG, for example) they should be checked in to version control.\n\nMake sure you have `libclang-dev` available so bindgen works.\n\n`cargo test` to run tests.\n\nThere is one provided example, which you can run with the following command:\n```\ncargo run --example svg_to_png\n```\n\nThis will convert the `example.svg` vector into a PNG. The PNG will be written to the working directory as `example_output.png`.\n\n## See also\n\nhttps://github.com/memononen/nanosvg\n\nhttps://github.com/rezrov/libnanosvg\n\n## License\n\nNanoSVG is licensed under [zlib license](lib/LICENSE.txt)\n\nSutte Hakkun logo is drawn by [Nico Vliek](https://www.behance.net/gallery/63535513/300-Super-Nintendo-Logos-Fully-Remastered), and is a registered trademark of Nintendo. Used for demonstration purposes only.\n\nMr Disk is drawn by [Eoin Stanley](http://www.eoinstanley.com/nintendo/index.htm), and is a registered trademark of Nintendo. Used for demonstration purposes only.\n\nAnything else is MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickbrowne%2Fnsvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickbrowne%2Fnsvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickbrowne%2Fnsvg/lists"}