---
title: "FontSettings.SetAllowedFonts"
url: "https://reference.aspose.com/psd/net/aspose.psd/fontsettings/setallowedfonts/"
product: "Aspose.PSD for .NET API Reference"
description: "FontSettings method. Restricts font using by list of fonts. Please check real font names before restriction Set Allowed font list to Null to remove restrictrions"
---

{{< psd/tize >}}
## FontSettings.SetAllowedFonts method

Restricts font using by list of fonts. Please check real font names before restriction Set Allowed font list to Null to remove restrictrions

```csharp
public static void SetAllowedFonts(string[] fontList)
```

| Parameter | Type | Description |
| --- | --- | --- |
| fontList | String[] | The font list. |

## Examples

The following code demonstrates the ability to programmatically limit fonts using.

```csharp
[C#]

string srcFile = "fonts_com_updated.psd";
string output = "etalon_fonts_com_updated.psd.png";

try
{
    var fontList = new string[] { "Courier New", "Webdings", "Bookman Old Style" };
    FontSettings.SetAllowedFonts(fontList);

    var myriadReplacement = new string[] { "Courier New", "Webdings", "Bookman Old Style" };
    var calibriReplacement = new string[] { "Webdings", "Courier New", "Bookman Old Style" };
    var arialReplacement = new string[] { "Bookman Old Style", "Courier New", "Webdings" };
    var timesReplacement = new string[] { "Arial", "NotExistedFont", "Courier New" };

    FontSettings.SetFontReplacements("MyriadPro-Regular", myriadReplacement);
    FontSettings.SetFontReplacements("Calibri", calibriReplacement);
    FontSettings.SetFontReplacements("Arial", arialReplacement);
    FontSettings.SetFontReplacements("Times New Roman", timesReplacement);

    using (PsdImage image = (PsdImage)Image.Load(srcFile,
        new PsdLoadOptions() { AllowNonChangedLayerRepaint = true }))
    {
        image.Save(output, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
    }
}
finally
{
    FontSettings.SetAllowedFonts(null);
    FontSettings.ClearFontReplacements();
}
```

### See Also

* class [FontSettings](../)
* namespace [Aspose.PSD](../../../aspose.psd/)
* assembly [Aspose.PSD](../../../)


