Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从RichTextBox Rtf中提取字体名称_C#_Richtextbox_Rtf - Fatal编程技术网

C# 如何从RichTextBox Rtf中提取字体名称

C# 如何从RichTextBox Rtf中提取字体名称,c#,richtextbox,rtf,C#,Richtextbox,Rtf,假设我的RichTextBox在C#中有特定的Rtf代码 "{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}" 我想做的是从给定的Rt

假设我的RichTextBox在C#中有特定的Rtf代码

"{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}"
我想做的是从给定的Rtf中提取字体名称,以便将其打印到控制台中。
所以我只想从给定的Rtf中获取Times New Roman和其他字体。

您的文件格式无效。它只是字体表部分。您可能需要解析它并从\fcharsetN到\fcharsetN中选择部分;您的文件格式无效。它只是字体表部分。您可能需要解析它并从\fcharsetN到\fcharsetN中选择部分;