データの読み込みと抽出| .NET

ディスクからCFFフォントをロードします

.NET APIのAspose.Fontでは、デジタルストレージに保存されているファイルからCFFフォントタイプを読み取ることができます。ディスクに保存されているCFFフォントファイルは、次の手順を使用してロードできます。

1// For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-.NET
2string fileName = dataDir + "OpenSans-Regular.cff"; //Font file name with full path
3
4FontDefinition fd = new FontDefinition(FontType.CFF, new FontFileDefinition("cff", new FileSystemStreamSource(fileName)));
5CffFont ttfFont = Aspose.Font.Font.Open(fd) as CffFont;

バイト配列からCFFフォントをロードします

また、次のコードサンプルを使用して、ストリームからCFFフォントをロードすることもできます。

1// For complete examples and data files, please go to https://github.com/aspose-font/Aspose.Font-for-.NET
2byte[] fontMemoryData = File.ReadAllBytes(dataDir + "OpenSans-Regular.cff");
3FontDefinition fd = new FontDefinition(FontType.CFF, new FontFileDefinition("cff", new ByteContentStreamSource(fontMemoryData)));
4CffFont cffFont = Aspose.Font.Font.Open(fd) as CffFont;

Have any questions about Aspose.Font?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.