View and Convert PSD with Custom Fonts

View and Convert PSD with custom fonts in C#

GroupDocs.Viewer for .NET (which is a part of Conholdate.Total for .NET) provides facility to view and convert PSD with custom fonts. You can set the default font when you rendering PSD file format.

How to set directories for fonts

To specify directories with your custom fonts, follow the below steps:

FolderFontSource folderFontSource = new FolderFontSource(@"C:\custom_fonts_folder", SearchOption.TopFolderOnly);
FontSettings.SetFontSources(folderFontSource);

Your fonts will be loaded before open your document.

Convert PSD with custom fonts

To convert PSD files with custom fonts with GroupDocs.Viewer for .NET follow the below steps:


// Create font sources.
// Add custom fonts folder to look for fonts recursively. (look into subfolders too).
FolderFontSource folderFontSource = new FolderFontSource(@"C:\custom_fonts_folder", SearchOption.AllFolders);
// Add custom fonts folder to look for fonts only in this folder (wihout subfolders).
FolderFontSource additionalFontSource = new FolderFontSource(@"C:\custom_additional_fonts_folder", SearchOption.TopFolderOnly);
// Call SetFontSources method and supply font sources as arguments.
FontSettings.SetFontSources(folderFontSource, additionalFontSource);

using (Viewer viewer = new Viewer("sample.psd"))
{
       JpgViewOptions options = new JpgViewOptions("result.jpg");
       options.DefaultFontName = "Arial";

       viewer.View(options); 
}