Skip to content

Commit

Permalink
Fixed some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Feb 22, 2024
1 parent 74bd5d3 commit d63bb58
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Docs/api/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API Reference

## [](#namespaces)Namespaces
## [Namespaces](#namespaces)

#### [Svg](xref:Svg)
[!include[](../namespaces/Svg.md)]
Expand Down
42 changes: 21 additions & 21 deletions Docs/articles/Faq.md
Original file line number Diff line number Diff line change
@@ -1,6 +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.
Expand All @@ -9,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?

Expand Down Expand Up @@ -69,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;
Expand All @@ -107,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
<!-- <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.6.20" />
</ItemGroup> -->
```
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:
```
Expand All @@ -148,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.
8 changes: 4 additions & 4 deletions Docs/articles/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,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
Expand Down Expand Up @@ -99,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.
Expand Down
4 changes: 2 additions & 2 deletions Docs/articles/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ You may check the [contributing guide](https://github.com/svg-net/SVG/blob/maste

## Downloads
The SVG-NET is available as [NuGet Package](https://www.nuget.org/packages/svg).
The respository includes
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).
* **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),
Expand Down
16 changes: 8 additions & 8 deletions Docs/articles/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,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
Expand Down Expand Up @@ -242,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)
Expand Down Expand Up @@ -281,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))
Expand Down Expand Up @@ -322,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
Expand Down Expand Up @@ -375,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
Expand Down

0 comments on commit d63bb58

Please sign in to comment.