在记事本中获取马拉雅拉姆语字体
我正在 C# Windows 应用程序中工作,我正在将一些内容写入记事本,print.txt 位于启动位置。编写后,我使用以下代码将其发送到打印机,
PrintDialog pd = new PrintDialog();
RawPrinterHelper.SendFileToPrinter(
pd.PrinterSettings.PrinterName,
Application.StartupPath + "\\print.txt");
但是这样做时我无法打印马拉雅拉姆语字体。但是马拉雅拉姆语进入记事本文件,甚至直接从记事本打印时也是如此。 任何人都可以提出解决方案 提前致谢
I am working in C# Windows application, i am writing some content to notepad, print.txt which is located at start up position. after writing i am sending it to printer using following code
PrintDialog pd = new PrintDialog();
RawPrinterHelper.SendFileToPrinter(
pd.PrinterSettings.PrinterName,
Application.StartupPath + "\\print.txt");
But when doing so i am not able to get malayalam font in print. But malayalam getting in the note pad file and even when printing directly from note pad.
Anyone can suggest a solution
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保你的文本是用 Unicode 编码的,你到底为什么还要使用记事本?地球上任何其他文本编辑程序都会做得更好。
Make sure your text is encoded in Unicode, and why on earth are you even using notepad? ANY other text-editing program on the planet would do a better job.
使用记事本创建的文本文件 (
.txt
) 不包含任何字体信息。记事本使用您选择的字体显示文本,但文件本身不包含字体或任何其他格式(粗体、斜体等)。您可以从方程式中删除记事本,并使用
RichTextBox
代替;该文件格式允许嵌入字体和其他信息(例如表格和图像)。然后,您可以将该文件发送到打印机,并让默认的.rtf
应用程序(写字板或 Word)来处理打印。如果您想在不使用外部应用程序的情况下以特定字体进行打印,则需要将正确的代码发送到打印机以设置打印机的内部字体,或者使用发送该信息的软件(例如 Word 或 PDF)。
设置打印机的内部字体是特定于供应商的,您需要检查打印机品牌和型号的文档,这些文档应该可以从打印机制造商处获得。
Text files (
.txt
) created with Notepad don't contain any font information. Notepad displays your text using the font you select, but the file itself doesn't contain fonts or any other formatting (bold, italic, and so forth).You can remove Notepad from the equation, and use a
RichTextBox
instead; that file format allows embedded fonts and other information (such as tables and images). You can then send that file to the printer, and let the default.rtf
application (WordPad or Word) to handle printing instead.If you want to print in a specific font without using an external application, you need to either send the proper codes to your printer to set the printer's internal font, or use software that sends that information instead (like Word or PDF).
Setting your printer's internal font is vendor specific, and you'd need to check the documentation for your printer brand and model, which should be available from the printer's manufacturer.
您可以使用您的代码打印其他语言,例如孟加拉语或印地语吗?如果没有,那么您的 C# 开发环境可能未启用 utf-8。
Can you print other language like Bangla or Hindi using your code? If not then probably your C# development environment isn't utf-8 enabled.