{"id":16162820,"url":"https://github.com/msrd0/svgwriter","last_synced_at":"2026-02-03T23:02:26.064Z","repository":{"id":60136393,"uuid":"517750552","full_name":"msrd0/svgwriter","owner":"msrd0","description":"Typed SVG Writer","archived":false,"fork":false,"pushed_at":"2024-09-13T21:49:58.000Z","size":553,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-30T21:41:40.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msrd0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"msrd0"}},"created_at":"2022-07-25T17:00:06.000Z","updated_at":"2024-09-13T21:50:01.000Z","dependencies_parsed_at":"2024-10-27T19:17:28.168Z","dependency_job_id":"11e282eb-fd81-4e4a-a4b3-d8bcc30b89f1","html_url":"https://github.com/msrd0/svgwriter","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.03448275862068961,"last_synced_commit":"afb2152e53fdb304735501f8d12717671e8f4e53"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/msrd0/svgwriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msrd0%2Fsvgwriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msrd0%2Fsvgwriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msrd0%2Fsvgwriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msrd0%2Fsvgwriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msrd0","download_url":"https://codeload.github.com/msrd0/svgwriter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msrd0%2Fsvgwriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29060635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T22:28:58.191Z","status":"ssl_error","status_checked_at":"2026-02-03T22:28:56.515Z","response_time":96,"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":[],"created_at":"2024-10-10T02:33:15.473Z","updated_at":"2026-02-03T23:02:26.047Z","avatar_url":"https://github.com/msrd0.png","language":"Rust","funding_links":["https://github.com/sponsors/msrd0"],"categories":[],"sub_categories":[],"readme":"# svgwriter ![License](https://img.shields.io/crates/l/svgwriter) [![svgwriter on crates.io](https://img.shields.io/crates/v/svgwriter)](https://crates.io/crates/svgwriter) [![svgwriter on docs.rs](https://docs.rs/svgwriter/badge.svg)](https://docs.rs/svgwriter) [![Source Code Repository](https://img.shields.io/badge/Code-On%20Codeberg-blue?logo=Codeberg)](https://codeberg.org/msrd0/svgwriter)\n\n`svgwriter` is a typed library for writing correct SVG files. It includes SVG\nspecification and documentation from [mdn][__link0].\n\n### Example\n\n```rust\nuse svgwriter::{\n\ttags::{Path, TagWithPresentationAttributes as _},\n\tData, Graphic\n};\n\nlet mut svg = Graphic::new();\nlet size = 100;\nsvg.set_width(size);\nsvg.set_height(size);\nsvg.set_view_box(format!(\"0 0 {size} {size}\"));\n\n// draw a heart, inspired by https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#example\nlet d = 40;\nlet padding = size / 2 - d;\nlet mut heart = Data::new();\nheart\n\t.move_to(padding, padding + d / 2)\n\t.arc_by(d / 2, d / 2, 0, false, true, d, 0)\n\t.arc_by(d / 2, d / 2, 0, false, true, d, 0)\n\t.quad_by(0, d * 3 / 4, -d, d * 3 / 2)\n\t.quad_by(-d,-d * 3 / 4, -d, -d * 3 / 2);\nsvg.push(\n\tPath::new()\n\t\t.with_d(heart)\n\t\t.with_fill(\"#A919FA\")\n\t\t.with_fill_opacity(0.5)\n\t\t.with_stroke(\"#A919FA\")\n\t\t.with_stroke_width(3)\n);\n\n// write the svg to a file\nwrite!(file, \"{}\", svg.to_string());\n```\n\nThis code produces the following image:\n\n\u003csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'\u003e\u003cpath d='M10,30a20,20,0,0,1,40,0a20,20,0,0,1,40,0q0,30,-40,60q-40,-30,-40,-60' fill='#A919FA' fill-opacity='0.5' stroke='#A919FA' stroke-width='3'/\u003e\u003c/svg\u003e\n\n![Image produced by example code](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%3E%3Cpath%20d='M10,30a20,20,0,0,1,40,0a20,20,0,0,1,40,0q0,30,-40,60q-40,-30,-40,-60'%20fill='%23A919FA'%20fill-opacity='0.5'%20stroke='%23A919FA'%20stroke-width='3'/%3E%3C/svg%3E)\n\n\n [__link0]: https://developer.mozilla.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsrd0%2Fsvgwriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsrd0%2Fsvgwriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsrd0%2Fsvgwriter/lists"}