Skip to content

Commit 9146b11

Browse files
Merge branch 'master' into readme-update
2 parents d146153 + 2828a90 commit 9146b11

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

PdfSharpCore/Utils/FontResolver.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,19 @@ static FontResolver()
5353
if (isWindows)
5454
{
5555
fontDir = System.Environment.ExpandEnvironmentVariables(@"%SystemRoot%\Fonts");
56-
SSupportedFonts = System.IO.Directory.GetFiles(fontDir, "*.ttf", System.IO.SearchOption.AllDirectories);
56+
var fontPaths = new List<string>();
57+
58+
var systemFontPaths = System.IO.Directory.GetFiles(fontDir, "*.ttf", System.IO.SearchOption.AllDirectories);
59+
fontPaths.AddRange(systemFontPaths);
60+
61+
var appdataFontDir = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Microsoft\Windows\Fonts");
62+
if(System.IO.Directory.Exists(appdataFontDir))
63+
{
64+
var appdataFontPaths = System.IO.Directory.GetFiles(appdataFontDir, "*.ttf", System.IO.SearchOption.AllDirectories);
65+
fontPaths.AddRange(appdataFontPaths);
66+
}
67+
68+
SSupportedFonts = fontPaths.ToArray();
5769
SetupFontsFiles(SSupportedFonts);
5870
return;
5971
}

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
# PdfSharpCore
22

3-
[![codecov.io](https://codecov.io/github/ststeiger/PdfSharpCore/coverage.svg?branch=master)](https://codecov.io/github/ststeiger/PdfSharpCore?branch=master) ![Nuget](https://img.shields.io/nuget/v/PdfSharpCore)
4-
5-
## About
3+
[![NuGet Version](https://img.shields.io/nuget/v/PdfSharpCore.svg)](https://www.nuget.org/packages/PdfSharpCore/)
4+
[![CI](https://github.com/ststeiger/PdfSharpCore/actions/workflows/build.yml/badge.svg)](https://github.com/ststeiger/PdfSharpCore/actions/workflows/build.yml)
5+
[![codecov.io](https://codecov.io/github/ststeiger/PdfSharpCore/coverage.svg?branch=master)](https://codecov.io/github/ststeiger/PdfSharpCore?branch=master)
66

77
**PdfSharpCore** is a partial port of [PdfSharp.Xamarin](https://github.com/roceh/PdfSharp.Xamarin/) for .NET Standard.
8-
Additionally MigraDoc has been ported as well (from version 1.32).<br />
9-
10-
Support for images has been implemented with [ImageSharp](https://github.com/SixLabors/ImageSharp).
11-
12-
## Example project
8+
Additionally MigraDoc has been ported as well (from version 1.32).
9+
Image support has been implemented with [SixLabors.ImageSharp](https://github.com/JimBobSquarePants/ImageSharp/) and Fonts support with [SixLabors.Fonts](https://github.com/SixLabors/Fonts).
1310

14-
An example project is not included in this repository, but exists in the repository linked below.
1511

16-
[Go to the example project](https://github.com/ststeiger/Stammbaum)
12+
## Table of Contents
1713

18-
### Font resolving
14+
- [Documentation](docs/index.md)
15+
- [Example](#example)
16+
- [Contributing](#contributing)
17+
- [License](#license)
1918

20-
There's a default font-resolver in [`FontResolver.cs`](https://github.com/ststeiger/PdfSharpCore/blob/master/PdfSharpCore/Utils/FontResolver.cs).<br />
21-
It should work on Windows, Linux, OSX and Azure. <br />
22-
Some limitations apply. <br />
23-
See open issues.
2419

25-
## Usage
20+
## Example
2621

2722
The following code snippet creates a simple PDF-file with the text 'Hello World!'.
2823
The code is written for a .NET 6 console app with top level statements.
@@ -50,8 +45,11 @@ gfx.DrawString("Hello World!", font, textColor, layout, format);
5045
document.Save("helloworld.pdf");
5146
```
5247

53-
See the [example project](#example-project) for MigraDoc usage.
48+
## Contributing
49+
50+
We appreciate feedback and contribution to this repo!
51+
5452

5553
## License
5654

57-
Distributed under the MIT License. See [`LICENSE.md`](LICENSE.md) for more information.
55+
This software is released under the MIT License. See the [LICENSE](LICENCE.md) file for more info.

0 commit comments

Comments
 (0)