Skip to content

Commit ffc2c6e

Browse files
Update Fonts to use new API
1 parent 7736ad3 commit ffc2c6e

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

samples/DrawShapesWithImageSharp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private static void OutputStars()
6363

6464
private static void DrawText(string text)
6565
{
66-
FontFamily fam = SystemFonts.Find("Arial");
66+
FontFamily fam = SystemFonts.Get("Arial");
6767
var font = new Font(fam, 30);
6868
var style = new RendererOptions(font, 72);
6969
IPathCollection glyphs = TextBuilder.GenerateGlyphs(text, style);
@@ -73,7 +73,7 @@ private static void DrawText(string text)
7373

7474
private static void DrawText(string text, IPath path)
7575
{
76-
FontFamily fam = SystemFonts.Find("Arial");
76+
FontFamily fam = SystemFonts.Get("Arial");
7777
var font = new Font(fam, 30);
7878
var style = new RendererOptions(font, 72)
7979
{

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta15" />
23+
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta15.10" />
2424
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />
2525
</ItemGroup>
2626

tests/ImageSharp.Drawing.Tests/Drawing/Text/DrawText.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class DrawText : BaseImageOperationsExtensionTest
2424
public DrawText()
2525
{
2626
this.fontCollection = new FontCollection();
27-
this.font = this.fontCollection.Install(TestFontUtilities.GetPath("SixLaborsSampleAB.woff")).CreateFont(12);
27+
this.font = this.fontCollection.Add(TestFontUtilities.GetPath("SixLaborsSampleAB.woff")).CreateFont(12);
2828
}
2929

3030
[Fact]

tests/ImageSharp.Drawing.Tests/Issues/Issue_46.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private static Font CreateFont(string fontName, int size)
4141
{
4242
var fontCollection = new FontCollection();
4343
string fontPath = TestFontUtilities.GetPath(fontName);
44-
return fontCollection.Install(fontPath).CreateFont(size);
44+
return fontCollection.Add(fontPath).CreateFont(size);
4545
}
4646
}
4747
}

tests/ImageSharp.Drawing.Tests/Issues/Issue_54.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void CanDrawWithoutMemoryException()
2323
// Creates a new image with empty pixel data.
2424
using (var image = new Image<Rgba32>(width, height))
2525
{
26-
FontFamily family = SystemFonts.Find("verdana");
26+
FontFamily family = SystemFonts.Get("verdana");
2727
Font font = family.CreateFont(48, FontStyle.Bold);
2828

2929
// The options are optional

tests/ImageSharp.Drawing.Tests/TestFontUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static Font GetFont(string name, float size)
3232
/// <param name="size">The font size.</param>
3333
/// <returns>The <see cref="Font"/></returns>
3434
public static Font GetFont(FontCollection collection, string name, float size)
35-
=> collection.Install(GetPath(name)).CreateFont(size);
35+
=> collection.Add(GetPath(name)).CreateFont(size);
3636

3737
/// <summary>
3838
/// The formats directory.

0 commit comments

Comments
 (0)