diff --git a/.github/workflows/builddocs.yml b/.github/workflows/builddocs.yml index 8c84cb1ee..28748fc5b 100644 --- a/.github/workflows/builddocs.yml +++ b/.github/workflows/builddocs.yml @@ -1,47 +1,48 @@ +# GitHub workflow file under .github/workflows/ name: DocBuild +# Trigger the action on push to master on: push: - branches: master + branches: + - master -defaults: - run: - shell: bash +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: - build_docs: + publish-docs: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: windows-latest steps: - - name: Checkout master - uses: actions/checkout@v2 - with: - path: main - - name: Get last commit message - run: | - cd main - echo "LAST_COMMIT=$(echo `git log -1 --pretty=%B`)" >> $GITHUB_ENV - cd .. - - name: Checkout gh-pages - uses: actions/checkout@v2 - with: - ref: gh-pages - path: doc - - name: Install requirements - run: choco install docfx -y - - name: Build documentation - run: | - echo `pwd` - cd main - docfx docfx.json - cd ../doc - git config --global core.autocrlf false - git config --global user.email "SVG@noreply.com" - git config --global user.name "CI Build" - cp -r ../main/_site/* . - git add -A - if [ `git status -s | wc -l` = 0 ]; then - echo "No changes in built documentation, skipping" - exit 0 - fi - git commit -m "$LAST_COMMIT" -q - git push origin gh-pages -q + - name: Checkout + uses: actions/checkout@v4 + - name: Dotnet Setup + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x + + - run: dotnet tool update -g docfx + - run: docfx Docs/docfx.json + + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: 'Docs/_site' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/Docs/.gitignore b/Docs/.gitignore new file mode 100644 index 000000000..4378419e7 --- /dev/null +++ b/Docs/.gitignore @@ -0,0 +1,9 @@ +############### +# folder # +############### +/**/DROP/ +/**/TEMP/ +/**/packages/ +/**/bin/ +/**/obj/ +_site diff --git a/Docs/Readme.md b/Docs/Readme.md new file mode 100644 index 000000000..2a8305ac6 --- /dev/null +++ b/Docs/Readme.md @@ -0,0 +1,20 @@ +![W3C SVG Logo](https://www.w3.org/Icons/SVG/svg-logo-v.png) +## SVG.NET + +Public fork of the C# SVG rendering library on CodePlex (now out of service). + +This started out as a private fork by [vvvv](https://vvvv.org) with some minor modification to enable the writing of proper SVG strings. +After almost two years of fixes and improvements the company decided to share the codebase with the public in order to improve it even further. +In 2021, the repository has been transferred from the company organization `vvvv` to the new organization `svg-net` (e.g. SVG.NET). + +Please feel free to fork it and open pull requests for any fix, improvement or feature you want to add. +You may check the [contributing guide](https://github.com/svg-net/SVG/blob/master/CONTRIBUTING.md) for more information on how to do this. + +## License +Licensed under the [MS-PL license](https://github.com/svg-net/SVG?tab=MS-PL-1-ov-file), + +This project has dependencies on other open-source projects. These projects are referenced via NuGet packages and might be subject to different licenses. + +|Project|Author|Sources|License| +|--------|-----|---|---------| +|ExCSS|Tyler Brinks (@tylerbrinks)|[GitHub](https://github.com/TylerBrinks/ExCSS)|[MIT](https://github.com/TylerBrinks/ExCSS/blob/master/license.txt)| diff --git a/Docs/api/.gitignore b/Docs/api/.gitignore new file mode 100644 index 000000000..e8079a3be --- /dev/null +++ b/Docs/api/.gitignore @@ -0,0 +1,5 @@ +############### +# temp file # +############### +*.yml +.manifest diff --git a/Docs/api/index.md b/Docs/api/index.md new file mode 100644 index 000000000..a4fa7287c --- /dev/null +++ b/Docs/api/index.md @@ -0,0 +1,27 @@ +# API Reference + +## [](#namespaces)Namespaces + +#### [Svg](xref:Svg) +[!include[](../namespaces/Svg.md)] + +#### [Svg.DataTypes](xref:Svg.DataTypes) +[!include[](../namespaces/Svg.DataTypes.md)] + +#### [Svg.Exceptions](xref:Svg.Exceptions) +[!include[](../namespaces/Svg.Exceptions.md)] + +#### [Svg.ExtensionMethods](xref:Svg.ExtensionMethods) +[!include[](../namespaces/Svg.ExtensionMethods.md)] + +#### [Svg.FilterEffects](xref:Svg.FilterEffects) +[!include[](../namespaces/Svg.FilterEffects.md)] + +#### [Svg.Pathing](xref:Svg.Pathing) +[!include[](../namespaces/Svg.Pathing.md)] + +#### [Svg.Transforms](xref:Svg.Transforms) +[!include[](../namespaces/Svg.Transforms.md)] + + + diff --git a/doc/Q&A.md b/Docs/articles/Faq.md similarity index 51% rename from doc/Q&A.md rename to Docs/articles/Faq.md index c7691df76..d4e73f68d 100644 --- a/doc/Q&A.md +++ b/Docs/articles/Faq.md @@ -1,5 +1,6 @@ +# Q & A This is currently a collection of answered questions in issues that have been closed meanwhile. -The format of the page is preliminary and maybe changed if more questions accumulate. +The format of the page is preliminary and may be changed, if more questions accumulate. ## How to get started Please use our [getting started article](http://svg-net.github.io/SVG/doc/GettingStarted.html) to get started with installation and implementation of the SVG library. @@ -8,19 +9,19 @@ Please use our [getting started article](http://svg-net.github.io/SVG/doc/Gettin (from [#327](https://github.com/svg-net/SVG/issues/327), by @flemingtech) -The rendering type plays a significant role on rendering speeds. For example, if anti-aliasing is off for the SvgDocument render times are notably faster. +The rendering type plays a significant role on rendering speeds. For example, if anti-aliasing is off for the `SvgDocument` render times are notably faster. -Because of the huge reduction in image quality, this wasn't a viable solution for my needs. Instead what I've come up with so far seems to work since I can't figure out how to get clipping regions to work. +Because of the huge reduction in image quality, this wasn't a viable solution for my needs. Instead, what I've come up with so far seems to work since I can't figure out how to get clipping regions to work. -After I load the SVG, I make new SVG with the same initial SvgDocument properties (basically a deep copy followed by deleting all children). As I walk the first document tree I'm looking for elements I know are going to be modified. For each one that I find, I remove it from the first SVG and put it into the 2nd SVG. When I'm doing this, I also apply any parent transforms to the new child since it doesn't need/have all of it's parents. +After I load the SVG, I make new SVG with the same initial `SvgDocumen`t properties (basically a deep copy followed by deleting all children). As I walk the first document tree I'm looking for elements I know are going to be modified. For each one that I find, I remove it from the first SVG and put it into the 2nd SVG. When I'm doing this, I also apply any parent transforms to the new child since it doesn't need/have all of its parents. -Once I'm done, I render the first SVG to an Image. When any of the 'animating' elements are changed, the 2nd SVG is rendered on top of a copy of the first SVG's rendering to form a complete composite. This prevents all the non-moving elements for having to re-render, unless of course the target graphics width/height changes. This is giving huge performance gains. +Once I'm done, I render the first SVG to an `Image`. When any of the 'animating' elements are changed, the 2nd SVG is rendered on top of a copy of the first SVG's rendering to form a complete composite. This prevents all the non-moving elements for having to re-render, unless of course the target graphics width/height changes. This is giving huge performance gains. ## Can I use SVG.NET in a UWP Windows 10 App? (from [#219](https://github.com/svg-net/SVG/issues/219), by @jonthysell) -SVG.NET requires the System.Drawing namespace, which is not available in UWP. See http://stackoverflow.com/questions/31545389/windows-universal-app-with-system-drawing-and-possible-alternative. +SVG.NET requires the `System.Drawing` namespace, which is not available in UWP. See http://stackoverflow.com/questions/31545389/windows-universal-app-with-system-drawing-and-possible-alternative. ## How to render an SVG image to a single-color bitmap image? @@ -68,19 +69,19 @@ Use `SvgDocument.Draw(int rasterWidth, int rasterHeight)`. If one of the values (from [#381](https://github.com/svg-net/SVG/issues/381), by @rangercej, answered by @gvheertum) -I used it in server side code (ASP.NET MVC application and API's) and never had any problems with it. There is however be possible issues regarding use in services and API's, for example the System.Drawing might not always be available in certain situations (if I am not mistaken, some Azure service will not provide the System.Drawing since it relies on GDI calls) and will also be an issue when using it as "portable" code for example in .NET standard or .NET core (but I believe the library is already working on a migration/compatibility with .NET core/standard). +I used it in server side code (ASP.NET MVC application and APIs) and never had any problems with it. There are however possible issues regarding the use in services and APIs, for example `System.Drawing` might not always be available in certain situations (if I am not mistaken, some Azure service will not provide `System.Drawing` since it relies on GDI calls) and will also be an issue when using it as "portable" code for example in .NET standard or .NET core (but I believe the library is already working on a migration/compatibility with .NET core/standard). -So issues when using System.Drawing are indeed possible when using in a non interactive scenario, since most non-interactive code will often be functioning as service or API, meaning a lot of synchronous calls are possible, which opens a world of possible problems compared to an interactive app which you often only have a few instances loaded. System.Drawing can (and often will) be resource-heavy, so having a lot of synchronous processes will possibly have a huge impact on the performance. So I guess, that is why Microsoft warns about the usage. Rendering a large complex SVG to a big bitmap (eg 5000x5000px) will put a large load on the server, doing this in parallel might cause issues in performance and availability. +So issues when using `System.Drawing` are indeed possible when using in a non-interactive scenario, since most non-interactive code will often be functioning as service or API, meaning a lot of synchronous calls are possible, which opens a world of possible problems compared to an interactive app which you often only have a few instances loaded. `System.Drawing` can (and often will) be resource-heavy, so having a lot of synchronous processes will possibly have a huge impact on the performance. So I guess, that is why Microsoft warns about the usage. Rendering a large complex SVG to a big bitmap (eg 5000x5000px) will put a large load on the server, doing this in parallel might cause issues in performance and availability. -System.Drawing was initially not really created for service usage, so you *can* use it, but really need to be aware of possible issues. For example, see this article: https://photosauce.net/blog/post/5-reasons-you-should-stop-using-systemdrawing-from-aspnet +`System.Drawing` was initially not really created for service usage, so you *can* use it, but really need to be aware of possible issues. For example, see this article: https://photosauce.net/blog/post/5-reasons-you-should-stop-using-systemdrawing-from-aspnet -I believe there are some parallelisation tests in the UnitTest suite, since the SVG component did have some concurrency issues in the past. The parallelisation tests show that some parallel work is possible, but upping the limit will show you that resource issues are to be expected under large loads. When failing, System.Drawing will often not fail gracefully, but will often crash with some meaningless error (which makes debugging pretty hard sometimes). +I believe there are some parallelization tests in the UnitTest suite, since the SVG component did have some concurrency issues in the past. The parallelization tests show that some parallel work is possible, but upping the limit will show you that resource issues are to be expected under large loads. When failing, `System.Drawing` will often not fail gracefully, but will often crash with some meaningless error (which makes debugging pretty hard sometimes). ## How to change the SvgUnit DPI? (from [#313](https://github.com/svg-net/SVG/issues/313), by @KieranSmartMP) -`SvgUnit` takes the DPI (which is called `Ppi` here) from the document. This is set to the system DPI at creation time, but can be set to another value afterwards, e.g. +`SvgUnit` takes the DPI (which is called `Ppi` here) from the document. This is set to the system DPI at creation time, but can be set to another value afterward, e.g. ```c# doc = SvgDocument(); doc.Ppi = 200; @@ -106,37 +107,37 @@ Custom attributes are publicly accessible as a collection, you can add an attrib (see [#494](https://github.com/svg-net/SVG/pull/495#issuecomment-505429874), by @ErlendSB) -This happens if libgdiplus is not installed under Linux or MacOs - libgdiplus is need for the implementation of System.Drawing.Common. The system will validate gdi+ capabilities when calling SvgDocument.Open(), if the gdi+ capabilities are not available, you will receive a SvgGdiPlusCannotBeLoadedException. +This happens if `libgdiplus` is not installed under Linux or macOs - `libgdiplus` is needed for the implementation of `System.Drawing.Common`. The system will validate gdi+ capabilities when calling SvgDocument.Open(), if the gdi+ capabilities are not available, you will receive a SvgGdiPlusCannotBeLoadedException. -There is a [packaging project on Github](https://github.com/CoreCompat/libgdiplus-packaging) that helps installing that, here are the installation instructions (copied here for convenience): +There is a [packaging project on Github](https://github.com/CoreCompat/libgdiplus-packaging) that helps to install that, here are the installation instructions (copied here for convenience): -Older versions of the package threw a NullReferenceException when calling the SvgDocument.Open function. The cause of these errors was the same. Newer releases (since version 3.0), will yield a more descriptive exception as described above. +Older versions of the package threw a `NullReferenceException` when calling the `SvgDocument.Open` function. The cause of these errors was the same. Newer releases (since version 3.0), will yield a more descriptive exception as described above. -### Using libgdiplus on Ubuntu Linux +### Using `libgdiplus` on Ubuntu Linux -You can install libgdiplus on Ubuntu Linux using the Quamotion PPA. Follow these steps: -``` +You can install `libgdiplus` on Ubuntu Linux using the Quamotion PPA. Follow these steps: +```bash sudo add-apt-repository ppa:quamotion/ppa sudo apt-get update sudo apt-get install -y libgdiplus ``` ### Using libgdiplus on macOS -On macOS, add a reference to the runtime.osx.10.10-x64.CoreCompat.System.Drawing package: +On macOS, add a reference to the `runtime.osx.10.10-x64.CoreCompat.System.Drawing` package: ```dotnet add package runtime.osx.10.10-x64.CoreCompat.System.Drawing``` -When building from source-code you can also uncomment the -``` +When building from source code you can also uncomment the +```xml ``` -block in the Svg.csproj file. +block in the `Svg.csproj` file. ### Validating GDI+ capabilities -If you want to make sure the executing system is capable of using the GDI+ features, you can use one of the functions available on the SvgDocument class. +If you want to make sure the executing system is capable of using the GDI+ features, you can use one of the functions available in the `SvgDocument` class. If you only want to get a boolean telling whether the capabilities are available, please use the following code: ``` @@ -147,4 +148,4 @@ If you want to ensure the capabilities and let an error be thrown when these are ``` SvgDocument.EnsureSystemIsGdiPlusCapable(); ``` -This function will throw a SvgGdiPlusCannotBeLoadedException if the capabilities are not available. +This function will throw a `SvgGdiPlusCannotBeLoadedException` if the capabilities are not available. diff --git a/doc/GettingStarted.md b/Docs/articles/GettingStarted.md similarity index 94% rename from doc/GettingStarted.md rename to Docs/articles/GettingStarted.md index e616dbb75..e21bea015 100644 --- a/doc/GettingStarted.md +++ b/Docs/articles/GettingStarted.md @@ -1,3 +1,5 @@ +# Getting Started + ## Getting the library Depending on the way you want to work with the library you can get the SVG library via NuGet, or roll your own binary from the sources or a personal fork of the sources. @@ -53,11 +55,11 @@ The library depends on GDI+ (see also [here](http://svg-net.github.io/SVG/doc/Q& .NET Core does not support GDI+ out of the box for non-Windows systems. For Mac and Linux you need to add a special compatibility package. This is not included in the packages by default, since this would break rendering on Windows systems. -I you distribute your application as platform independent, you might want to add the following instructions (or a reference to this guide) +If you distribute your application as platform independent, you might want to add the following instructions (or a reference to this guide) in your installation instructions to aid Mac and Linux users that want to utilize your application/library. ### Linux (Ubuntu) -For Linux you need to install `libgdiplus` from the `quamotion/ppa` feed on your machine/container: +For Linux, you need to install `libgdiplus` from the `quamotion/ppa` feed on your machine/container: ``` sudo add-apt-repository ppa:quamotion/ppa sudo apt-get update @@ -97,9 +99,9 @@ dotnet add reference SVG/sources/Svg.csproj This approach will also take over all references required to the target project (e.g. when you added the `CoreCompat` package for Mac). This will also compile the Svg sources when you build your own project, which might be useful if you plan to make changes in the Svg project yourself. -If you don't want to reference the project, you can get the `Svg.dll` file from the outpot folders after you compiled the project with the steps outlined above and reference it. +If you don't want to reference the project, you can get the `Svg.dll` file from the output folders after you compiled the project with the steps outlined above and reference it. The Svg library does not utilize other external references under Windows, and by only using the `Svg.dll` file you will be able to use the library. -However please keep in mind that the Mac and Linux versions require additional tooling/packages. +However, please keep in mind that the Mac and Linux versions require additional tooling/packages. ## Using the library (examples) This part will be extended in the future, for now please refer to the [Q&A](http://svg-net.github.io/SVG/doc/Q&A.html) for examples of how to use the library. diff --git a/Docs/articles/Introduction.md b/Docs/articles/Introduction.md new file mode 100644 index 000000000..2f8347257 --- /dev/null +++ b/Docs/articles/Introduction.md @@ -0,0 +1,28 @@ +# SVG.NET + +Public fork of the C# SVG rendering library on CodePlex (now out of service). + +This started out as a private fork by [vvvv](https://vvvv.org) with some minor modification to enable the writing of proper SVG strings. +After almost two years of fixes and improvements the company decided to share the codebase with the public in order to improve it even further. +In 2021, the repository has been transferred from the company organization `vvvv` to the new organization `svg-net` (e.g. SVG.NET). + +Please feel free to fork it and open pull requests for any fix, improvement or feature you want to add. +You may check the [contributing guide](https://github.com/svg-net/SVG/blob/master/CONTRIBUTING.md) for more information on how to do this. + +## Downloads +The SVG-NET is available as [NuGet Package](https://www.nuget.org/packages/svg). +The repository includes +* **Source:** The main source code directory. +* **Generators:** A Roslyn source code generator for generating the SVG factory elements. +* **Tests:** NUnit based test unit project, benchmark project and other test tools, and +* **Samples:** For sample applications +* **Docs:** For the documentations (in Markdown format). + +## License +Licensed under the [MS-PL license](https://github.com/svg-net/SVG?tab=MS-PL-1-ov-file), + +This project has dependencies on other open-source projects. These projects are referenced via NuGet packages and might be subject to different licenses. + +|Project|Author|Sources|License| +|--------|-----|---|---------| +|ExCSS|Tyler Brinks (@tylerbrinks)|[GitHub](https://github.com/TylerBrinks/ExCSS)|[MIT](https://github.com/TylerBrinks/ExCSS/blob/master/license.txt)| diff --git a/Docs/articles/License.md b/Docs/articles/License.md new file mode 100644 index 000000000..fd8762e96 --- /dev/null +++ b/Docs/articles/License.md @@ -0,0 +1,44 @@ +# Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you accept this license. +If you do not accept the license, do not use the software. + +## 1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +## 2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, +each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, +prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, +each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, +use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of +the contribution in the software. + +## 3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, +your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, +and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license +by including a complete copy of this license with your distribution. If you distribute any portion of the software +in compiled or object code form, you may only do so under a license that complies with this license. + +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, +guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. +To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, +fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/doc/ReleaseNotes.md b/Docs/articles/ReleaseNotes.md similarity index 96% rename from doc/ReleaseNotes.md rename to Docs/articles/ReleaseNotes.md index a84e7f457..fda6d09f8 100644 --- a/doc/ReleaseNotes.md +++ b/Docs/articles/ReleaseNotes.md @@ -6,7 +6,7 @@ The release versions are NuGet releases. ### Changes * Added: A class, `SvgOptions`, with external css parameters for styling or transforming the `SvgDocument`. * Added: Support for .NET 4.7.2, .NET 4.8.1 and .NET 8.0. -* [Breaking change] The support for .NET 8 resulted in a breaking change to the signature of methods in `CoordinateParser`. +* [Breaking Change] The support for .NET 8 resulted in a breaking change to the signature of methods in `CoordinateParser`. * The changes are needed to fix a compiler error `CS8352`. * The use of read-only arguments as referenced variable is not necessary. * The use of `ref` in the function arguments resulting in `CS8352` error are all removed. @@ -15,13 +15,18 @@ The release versions are NuGet releases. * made exceptions serializable to be able to cross AppDomain boundaries (see [#826](https://github.com/svg-net/SVG/pull/826)) ### Fixes -* fixed XML namespace prefixes are also applied for nodes declaring them (see [PR #1106](https://github.com/svg-net/SVG/pull/1106)) -* fixed Parameter is not valid (see [PR #1131](https://github.com/svg-net/SVG/pull/1131)) +* Fixed: XML namespace prefixes are also applied for nodes declaring them (see [PR #1106](https://github.com/svg-net/SVG/pull/1106)). +* Fixed: Parameter is not valid (see [PR #1131](https://github.com/svg-net/SVG/pull/1131)). + +### Infrastructure +* Moved: The `ReleaseNotes.md` to `Docs/ReleaseNotes.md`. +* Repository clean-up, reducing the download zip size from 22MB to 4.5MB. ### Infrastructure * Split tests SVG/PNG files into Issues and W3C Test Suite. W3C Test Suite files are not automatically downloaded. * Repository clean-up, reducing the download zip size from 22MB to 4.5MB. * Added: A new project, `Tests/Svg.Tests.Common` for sharing codes between test applications. +* Moved: The `ReleaseNotes.md` to `Docs/ReleaseNotes.md`. ## [Version 3.4.6](https://www.nuget.org/packages/Svg/3.4.6) (2023-11-16) @@ -127,14 +132,14 @@ The release versions are NuGet releases. * prevent `ISvgRenderer.SmoothingMode` reset when `RequiresSmoothRendering` is `true` (see [#882](https://github.com/svg-net/SVG/issues/882)) * ignore `x` and `y` attributes in outermost svg as per standard (see [#886](https://github.com/svg-net/SVG/issues/886)) -* fixed index is outside arrary boundary (see [#888](https://github.com/svg-net/SVG/issues/888)) +* fixed index is outside array boundary (see [#888](https://github.com/svg-net/SVG/issues/888)) ## [Version 3.2.3](https://www.nuget.org/packages/Svg/3.2.3) (2021-01-12) ### Enhancements * implement font-weight bolder and lighter (see [PR #727](https://github.com/svg-net/SVG/pull/727)) * check if BaseUri is absolute (see [PR #738](https://github.com/svg-net/SVG/pull/738)) -* added support for `miter-clip` and `arcs` line joins, and for `fr` radial gradiant property +* added support for `miter-clip` and `arcs` line joins, and for `fr` radial gradient property (SVG2 features, see [PR #621](https://github.com/svg-net/SVG/pull/621)) ### Fixes @@ -237,7 +242,7 @@ _**Note:**_ To build it yourself, you need at least Visual Studio 2017 due to the added multi-platform support. ### Enhancements -* added support for .NET Core 2.2 (see PR [#448](https://github.com/svg-net/SVG/pull/448)) +* added support for .NET Core 2.2 (see PR [#448](https://github.com/svg-net/SVG/pull/448))[Faq.md](Faq.md) * handle missing gdi+ library on MacOs or Linux by a descriptive exception (see [#501](https://github.com/svg-net/SVG/issues/501)) * allow ID start with a number (see [#138](https://github.com/svg-net/SVG/issues/138)) * added support for embedded SVG in data URIs (see [#71](https://github.com/svg-net/SVG/issues/71) @@ -276,7 +281,7 @@ To build it yourself, you need at least Visual Studio 2017 due to the added mult * prevent exception for zero bounds and opacity not one (see [#479](https://github.com/svg-net/SVG/issues/479)) * make sure mask elements are written back to svg (see [#271](https://github.com/svg-net/SVG/issues/271)) * fixed incorrect clip region (see [#363](https://github.com/svg-net/SVG/issues/363)) -* fixed overflow error on 1 character text with tspan (see [#488](https://github.com/svg-net/SVG/issues/488)) +* fixed overflow error on 1-character text with tspan (see [#488](https://github.com/svg-net/SVG/issues/488)) * fixed crash with unsupported pseudo classes (see [#315](https://github.com/svg-net/SVG/issues/315)) * fixes wrong text position in some scenarios (see PR [#475](https://github.com/svg-net/SVG/pull/475)) * fixed handling of spaces for `xml:space="default"` (see PR [#471](https://github.com/svg-net/SVG/pull/471)) @@ -317,14 +322,14 @@ To build it yourself, you need at least Visual Studio 2017 due to the added mult (see [#272](https://github.com/svg-net/SVG/issues/272)) * several fixes for markers: * added support for marker attributes in groups - * partly fixed marker appearance (stroke and fill color, scaling, deafult orientation) + * partly fixed marker appearance (stroke and fill color, scaling, default orientation) * apply transformations in the marker drawing element (see [#215](https://github.com/svg-net/SVG/issues/215)) - * correctly show mid markers for paths with Bezier curves + * correctly show middle markers for paths with Bezier curves * handle markers on paths with successive equal points ## [Version 2.4.1](https://www.nuget.org/packages/Svg/2.4.1) (2019-01-25) ### Changes -* `ExCSS` lives now in the `Svg` namespace to avoid namespace collusions +* `ExCSS` lives now in the `Svg` namespace to avoid namespace collisions (see [#408](https://github.com/svg-net/SVG/issues/408)) ### Fixes @@ -370,7 +375,7 @@ To build it yourself, you need at least Visual Studio 2017 due to the added mult * fixed path parsing mistaking 'E' as a command instead of an exponent * fixed image opacity * fixed usage of `ms colortranslator` class - * fixed inproper use of UTF8Encoding + * fixed improper use of UTF8Encoding * fixed runtime error after accessing added `SvgText` element (see [#332](https://github.com/svg-net/SVG/issues/332)) * fixed rendering error due to invalid `ColorBlend` position * fixed inheriting `text-anchor` and `baseline-shift` attributes diff --git a/doc/Samples.md b/Docs/articles/Samples.md similarity index 100% rename from doc/Samples.md rename to Docs/articles/Samples.md diff --git a/Docs/articles/toc.yml b/Docs/articles/toc.yml new file mode 100644 index 000000000..7e48ce876 --- /dev/null +++ b/Docs/articles/toc.yml @@ -0,0 +1,12 @@ +- name: Introduction + href: Introduction.md +- name: Getting Started + href: GettingStarted.md +- name: Q&A + href: Faq.md +- name: Release Notes + href: ReleaseNotes.md +- name: Sample Code + href: Samples.md +- name: License + href: License.md diff --git a/Docs/docfx.json b/Docs/docfx.json new file mode 100644 index 000000000..9eeccb10f --- /dev/null +++ b/Docs/docfx.json @@ -0,0 +1,91 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ + "Svg.csproj" + ], + "src": "../Source/", + "properties": { + "TargetFramework": "net8.0" + } + } + ], + "dest": "api", + "outputFormat": "mref", + "includePrivateMembers": false, + "disableGitFeatures": false, + "disableDefaultFilter": false, + "filter": "filterConfig.yml", + "noRestore": false, + "namespaceLayout": "flattened", + "memberLayout": "samePage", + "enumSortOrder": "alphabetic", + "allowCompilationErrors": false + } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "api/index.md" + ] + }, + { + "files": [ + "articles/**.md", + "articles/**/toc.yml", + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "overwrite": [ + { + "files": [ + "namespaces/**.md" + ], + "exclude": [ + "obj/**" + ] + } + ], + "globalMetadata": { + "_appName": "SVG-NET", + "_appTitle": "SVG-NET Documentation", + "_appLogoPath": "images/svg.png", + "_appFaviconPath": "images/svg.png", + "_enableDiagrams": true, + "_enableSearch": true, + "pdf": false, + "pdfTocPage": false, + "_appFooter": "

© Copyright 2009 Microsoft. All Rights Reserved. © Copyright 2011 vvvv Group. All Rights Reserved. © Copyright 2021 SVG.NET Contributors.

Made with DocFX

", + "_gitContribute": { + "repo": "https://github.com/svg-net/SVG", + "branch": "master" + }, + "_gitUrlPattern": "github" + }, + "output": "_site", + "xref": [ "https://github.com/dotnet/docfx/raw/main/.xrefmap.json" ], + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default", + "modern", + "template" + ], + "postProcessors": [], + "keepFileLink": false, + "disableGitFeatures": false + } +} diff --git a/Docs/filterConfig.yml b/Docs/filterConfig.yml new file mode 100644 index 000000000..0050232aa --- /dev/null +++ b/Docs/filterConfig.yml @@ -0,0 +1,4 @@ +apiRules: +- exclude: + uidRegex: ^Svg\.Document_Structure$ + type: Namespace diff --git a/Docs/images/svg.png b/Docs/images/svg.png new file mode 100644 index 000000000..abb41c43c Binary files /dev/null and b/Docs/images/svg.png differ diff --git a/index.md b/Docs/index.md similarity index 51% rename from index.md rename to Docs/index.md index ce060e15d..a066882c1 100644 --- a/index.md +++ b/Docs/index.md @@ -5,14 +5,14 @@ Welcome to the documentation for the SVG.NET library! ### Usage documentation -- [Getting Started](doc/GettingStarted.html) -- [Q&A](doc/Q&A.html) -- [Generated API documentation](api/Svg.html) -- [Sample Code](doc/Samples.html) +- [Getting Started](articles/GettingStarted.md) +- [Q&A](articles/Faq.md) +- [Generated API documentation](api/index.md) +- [Sample Code](articles/Samples.md) ### Project documentation -- [Release Notes](doc/ReleaseNotes.html) -- [Contributing Guide](CONTRIBUTING.html) +- [Release Notes](articles/ReleaseNotes.md) +- [Contributing Guide](https://github.com/svg-net/SVG/blob/master/CONTRIBUTING.md) _Note that this documentation is work in progress. You are always welcome to help improving it!_ \ No newline at end of file diff --git a/Docs/namespaces/Svg.DataTypes.md b/Docs/namespaces/Svg.DataTypes.md new file mode 100644 index 000000000..34543de52 --- /dev/null +++ b/Docs/namespaces/Svg.DataTypes.md @@ -0,0 +1,5 @@ +--- +uid: Svg.DataTypes +summary: *content +--- +The **Svg.DataTypes** namespace contains classes defining the basic data types used by this SVG for .NET library. diff --git a/Docs/namespaces/Svg.Exceptions.md b/Docs/namespaces/Svg.Exceptions.md new file mode 100644 index 000000000..636685754 --- /dev/null +++ b/Docs/namespaces/Svg.Exceptions.md @@ -0,0 +1,5 @@ +--- +uid: Svg.Exceptions +summary: *content +--- +The **Svg.Exceptions** namespace contains .NET exception classes defined by this SVG for .NET library. diff --git a/Docs/namespaces/Svg.ExtensionMethods.md b/Docs/namespaces/Svg.ExtensionMethods.md new file mode 100644 index 000000000..db0adc235 --- /dev/null +++ b/Docs/namespaces/Svg.ExtensionMethods.md @@ -0,0 +1,5 @@ +--- +uid: Svg.ExtensionMethods +summary: *content +--- +The **Svg.ExtensionMethods** namespace contains .NET extension classes defined by this SVG for .NET library. diff --git a/Docs/namespaces/Svg.FilterEffects.md b/Docs/namespaces/Svg.FilterEffects.md new file mode 100644 index 000000000..0558e1e9a --- /dev/null +++ b/Docs/namespaces/Svg.FilterEffects.md @@ -0,0 +1,5 @@ +--- +uid: Svg.FilterEffects +summary: *content +--- +The **Svg.FilterEffects** namespace contains classes implementing the SVG filter effects. diff --git a/Docs/namespaces/Svg.Pathing.md b/Docs/namespaces/Svg.Pathing.md new file mode 100644 index 000000000..edce814bf --- /dev/null +++ b/Docs/namespaces/Svg.Pathing.md @@ -0,0 +1,5 @@ +--- +uid: Svg.Pathing +summary: *content +--- +The **Svg.Pathing** namespace contains classes implementing the SVG path. diff --git a/Docs/namespaces/Svg.Transforms.md b/Docs/namespaces/Svg.Transforms.md new file mode 100644 index 000000000..eb5a621df --- /dev/null +++ b/Docs/namespaces/Svg.Transforms.md @@ -0,0 +1,5 @@ +--- +uid: Svg.Transforms +summary: *content +--- +The **Svg.Transforms** namespace contains classes defining SVG matrix transformation classes. diff --git a/Docs/namespaces/Svg.md b/Docs/namespaces/Svg.md new file mode 100644 index 000000000..85bf0d15d --- /dev/null +++ b/Docs/namespaces/Svg.md @@ -0,0 +1,6 @@ +--- +uid: Svg +summary: *content +--- +The **Svg** namespace contains the main classes and interfaces implementing the SVG specifications. +The classes are based on the W3C SVG interfaces, but not strictly implementing the W3C SVG interfaces. diff --git a/Docs/template/public/main.css b/Docs/template/public/main.css new file mode 100644 index 000000000..47e6721da --- /dev/null +++ b/Docs/template/public/main.css @@ -0,0 +1,11 @@ +/* Checkout https://getbootstrap.com/docs/5.3/customize/color/ for more customization options */ +.navbar-brand #logo { + width: 36px; + height: 36px; + margin-right:10px; +} +/* +#navbar ul.navbar-nav { + margin-top: -3px; +} + */ \ No newline at end of file diff --git a/Docs/template/public/main.js b/Docs/template/public/main.js new file mode 100644 index 000000000..ad118d7f3 --- /dev/null +++ b/Docs/template/public/main.js @@ -0,0 +1,14 @@ +export default { + iconLinks: [ + { + icon: 'github', + href: 'https://github.com/svg-net/SVG', + title: 'GitHub: SVG-NET' + }, + { + icon: 'filetype-svg', + href: 'https://developer.mozilla.org/en-US/docs/Web/SVG', + title: 'SVG: Scalable Vector Graphics' + } + ] +} diff --git a/Docs/toc.yml b/Docs/toc.yml new file mode 100644 index 000000000..a05632031 --- /dev/null +++ b/Docs/toc.yml @@ -0,0 +1,5 @@ +- name: Articles + href: articles/ +- name: API Reference + href: api/ + topicHref: api/index.md \ No newline at end of file diff --git a/README.md b/README.md index be90a5f4c..f3f432730 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,25 @@ ![W3C SVG Logo](https://www.w3.org/Icons/SVG/svg-logo-v.png) # SVG.NET[![NuGet version](https://badge.fury.io/nu/svg.svg)](https://badge.fury.io/nu/svg) [![Gitter](https://badges.gitter.im/vvvv/SVG.svg)](https://gitter.im/vvvv/SVG?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) ![Testsuite](https://github.com/svg-net/SVG/workflows/Testsuite/badge.svg?branch=master) ![DocBuild](https://github.com/svg-net/SVG/workflows/DocBuild/badge.svg?branch=master) -Public fork of the C# SVG rendering library on codeplex. +Public fork of the C# SVG rendering library on CodePlex. -This started out as a minor modification to enable the writing of proper SVG strings. But now after almost two years we have so many fixes and improvements that we decided to share our current codebase to the public in order to improve it even further. +This started out as a private fork by [vvvv](https://vvvv.org) with some minor modification to enable the writing of proper SVG strings. +After almost two years of fixes and improvements the company decided to share the codebase with the public in order to improve it even further. +In 2021, the repository has been transferred from the company organization `vvvv` to the new organization `svg-net` (e.g. SVG.NET). -So please feel free to fork it and open pull requests for any fix, improvement or feature you add. +## Contributing +This project is in need of contributors. +Assistance in areas such as code reviews and testing is particularly needed. +If you can contribute, your help would be invaluable. +For those interested in leading or contributing to specific initiatives like the codebase segmentation, please let us know. + +Please feel free to fork the repository and open pull requests for any fix, improvement or feature you want to add. You may check the [contributing guide](https://github.com/svg-net/SVG/blob/master/CONTRIBUTING.md) for more information on how to do this. +## Documentation For information on installation and usage of the library, and for release notes please check the [documentation pages](https://svg-net.github.io/SVG/). +Note that the documentation is incomplete - any help to improve it is greatly appreciated! + ## Projects using the library @@ -18,7 +29,7 @@ For information on installation and usage of the library, and for release notes * [Chordious](https://chordious.com) a fretboard diagram generator for fretted stringed instruments. * [HttpMaster](https://www.httpmaster.net) a Windows tool for HTTP testing and debugging. -If you want your project in this list, send me a pull request on this file or link + short description to tebjan (at) vvvv.org +If you want your project in this list, send a pull request on this file, or a link and short description to tebjan (at) vvvv.org. ## License Licensed under the MS-PL license. diff --git a/Source/Svg.csproj b/Source/Svg.csproj index fe75c36cb..7baabcff6 100644 --- a/Source/Svg.csproj +++ b/Source/Svg.csproj @@ -16,7 +16,7 @@ So please feel free to fork it and open pull requests for any fix, improvement or feature you add. License: Microsoft Public License. - Copyright © vvvv.org + © Copyright 2009 Microsoft. All Rights Reserved. © Copyright 2011 vvvv Group. All Rights Reserved. © Copyright 2021 SVG.NET Contributors svg, vector graphics, rendering {886A98C5-37C0-4E8B-885E-30C1D2F98B47} Debug;Release diff --git a/docfx.json b/docfx.json deleted file mode 100644 index eab221989..000000000 --- a/docfx.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "metadata": [ - { - "src": [ - { - "files": [ "**/*.csproj" ], - "exclude": [ "**/bin/**", "**/obj/**" ], - "src": "Source" - } - ], - "dest": "obj/api" - } - ], - "build": { - "content": [ - { - "files": [ "**/*.yml" ], - "src": "obj/api", - "dest": "api" - }, - { - "files": [ "*.md", "doc/*.md" ] - } - ], - "globalMetadata": { - "_appTitle": "SVG.NET API", - "_enableSearch": true - }, - "markdownEngineName": "markdig", - "dest": "_site", - "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ] - } -}