更改记事本文件中的字体样式 [英] changing Font style in notepad file

查看:255
本文介绍了更改记事本文件中的字体样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有我已经创建了一个小型应用程序,从我的应用程序中,我正在将我的输出写入记事本文件中,当我编写输出时,我也会声明字体..

但我的字体没有分配给记事本文件,
以下是我的代码

hi all i have created small application, from my application i am writing my output in a notepad file, when i write my output i will declare font too..

but my font is not assigning to the notepad file ,
below is my code

using (StreamWriter writer = new StreamWriter(Server.MapPath("~/Temp_Report/" + Session["User"] + ".Barcode.txt"), true))
          {
              Font font1 = new System.Drawing.Font("IDAutomationSC128M DEMO", 11);//// Font name(font Declaration)
              writer.WriteLine("THAMEEM HOME CENTET,L.L.C");
              writer.WriteLine("Same Value", font1);
              writer.WriteLine("Short Description");
}


为我的问题提供解决方案..


give me solution for my issue..

推荐答案

文本文件不包含格式.用户可以在应用程序中选择字体和大小,但它不会存储在文本文件中.

如果需要包括格式在内的文件类型,请考虑使用pdf,doc,html等.
Text files do not include formatting. The user can select a font and size in the application but it is not stored in the text file.

If you need file type including formatting, consider using pdf, doc, html etc.


请看以下代码项目文章.

NRTFTree-在C#中用于RTF处理的类库 [
Take a look at the following codeproject article.

NRTFTree - A class library for RTF processing in C#[^]

Think this is exactly what you need.


这篇关于更改记事本文件中的字体样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆