Skip to content

Commit

Permalink
fix: magickSettings: use backing Drawing property instead of options (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gounlaf committed Jan 18, 2024
1 parent de25c38 commit 9583661
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/Magick.NET/Settings/MagickSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public FillRule FillRule
/// </summary>
public string? FontFamily
{
get => GetOption("family");
get => Drawing.FontFamily;
set
{
SetOptionAndArtifact("family", value);
Expand All @@ -191,7 +191,7 @@ public double FontPointsize
/// </summary>
public FontStyleType FontStyle
{
get => EnumHelper.Parse(GetOption("style"), FontStyleType.Undefined);
get => Drawing.FontStyle;
set
{
SetOptionAndArtifact("style", value);
Expand All @@ -204,18 +204,7 @@ public FontStyleType FontStyle
/// </summary>
public FontWeight FontWeight
{
get
{
var weight = GetOption("weight");
if (string.IsNullOrEmpty(weight))
return FontWeight.Undefined;

if (!int.TryParse(weight, NumberStyles.Number, CultureInfo.InvariantCulture, out var fontweight))
return FontWeight.Undefined;

return EnumHelper.Parse(fontweight, FontWeight.Undefined);
}

get => Drawing.FontWeight;
set
{
SetOptionAndArtifact("weight", ((int)value).ToString(CultureInfo.InvariantCulture));
Expand Down

0 comments on commit 9583661

Please sign in to comment.