分配PrinterName后打印字体不可用 [英] Print font not available after assigning PrinterName

查看:61
本文介绍了分配PrinterName后打印字体不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


在VS.NET VB,.NET Framework 1.1.4322上开发一个Windows窗体程序,它是在
windows XP Pro,SP2上运行的。


在打印文档之前,我想将字体设置为我打印的打印机只有

的字体(Zebra TLP2844) 。


当我打开Word并查看默认打印机可用的字体时,

不会显示我想要的字体。如果我打印机打印机打印机

有我想要的字体,我想要的字体显示在字体选择中。

这似乎适用于任何程序,允许我选择一个字体

打印(Excel,记事本等)


在我的VB程序中,我将PrinterSettings.PrinterName属性设置为打印机的名称

,其中包含我要打印的字体。之后我将
设置打印字体为我想要的字体,这与打印机

在PrinterSettings.PrinterName中相关联。


当我去打印时,它不使用我期望的字体。它使用

Microsoft Sans Serif字体。


我已通过调试器,我可以看到它正在从PrinterSettings.InstalledPrinters中取出

正确的打印机。我可以更改为为默认打印机安装的其他

字体,并打印在那些

字体中。即使我将
设置为Zebra打印机的PrinterSettings.PrinterName,我也不能改为Zebra打印机的字体。


我如何更改为仅与我想要使用的打印机相关联的字体?


感谢任何帮助。


谢谢,

Tony

Hello.

Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a
windows XP Pro, SP2.

Before printing a document, i want to set the font to a font that is only
available with the printer that i am printing to(Zebra TLP2844).

When i open Word and look at the fonts available for the default printer, it
does not show the fonts i want. If i cahnge the printer to the printer that
has the font that i want, the font i want shows up in the font selections.
This seems to be true for any program that allows me to select a font for
printing (Excel, Notepad, etc.)

In my VB program i set the PrinterSettings.PrinterName property to the name
of the printer that has the fonts that i want to print with. After that i
set the print font to the font i want, which is associated with the printer
in PrinterSettings.PrinterName.

When i go to print, it does not use the font that i am expecting. It uses
the "Microsoft Sans Serif" font.

I have taken it through the debugger and i can see that it is picking up the
right printer from PrinterSettings.InstalledPrinters. I can change to other
fonts that are installed for the default printer and it prints in those
fonts. I just can''t change to a font for the Zebra printer even though i
set the PrinterSettings.PrinterName to the Zebra printer.

How do i change to the font that is only associated with the printer that i
am trying to use ?

Any help would be gratefully appreciated.

Thanks,
Tony

推荐答案

请显示您为此所做的代码。

" Tony Girgenti" < tony(nospam)@ lakesideos.com写信息

新闻:OS ************** @ TK2MSFTNGP04.phx.gbl ...
Please show your code you are doing for this.
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:OS**************@TK2MSFTNGP04.phx.gbl...

Hello。


在VS.NET VB,.NET Framework 1.1.4322上开发Windows窗体程序

a windows XP Pro,SP2。


在打印文档之前,我想将字体设置为打印机可用的字体,而不是
我打印到(Zebra TLP2844)。


当我打开Word并查看默认打印机可用的字体时,

它不显示字体我想要。如果我将打印机更换为具有我想要的字体的打印机

,我想要的字体显示为字体

选择。这似乎适用于任何允许我选择

a字体进行打印的程序(Excel,记事本等)


在我的VB程序中我设置PrinterSettings.PrinterName属性为具有我想要打印的字体的打印机的

名称。在

之后,我将打印字体设置为我想要的字体,该字体与PrinterSettings.PrinterName中的

打印机相关联。


当我去打印时,它不使用我期望的字体。它使用

Microsoft Sans Serif字体。


我已通过调试器,我可以看到它正在从PrinterSettings.InstalledPrinters中选择正确的打印机。我可以更改为

为默认打印机安装的其他字体,它打印在

这些字体中。虽然我将PrinterSettings.PrinterName设置为Zebra打印机,但我无法更改为Zebra打印机的字体




我如何更改为仅与打印机相关联的字体

i尝试使用?


任何帮助都将非常感激。


谢谢,

Tony

Hello.

Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on
a windows XP Pro, SP2.

Before printing a document, i want to set the font to a font that is only
available with the printer that i am printing to(Zebra TLP2844).

When i open Word and look at the fonts available for the default printer,
it does not show the fonts i want. If i cahnge the printer to the printer
that has the font that i want, the font i want shows up in the font
selections. This seems to be true for any program that allows me to select
a font for printing (Excel, Notepad, etc.)

In my VB program i set the PrinterSettings.PrinterName property to the
name of the printer that has the fonts that i want to print with. After
that i set the print font to the font i want, which is associated with the
printer in PrinterSettings.PrinterName.

When i go to print, it does not use the font that i am expecting. It uses
the "Microsoft Sans Serif" font.

I have taken it through the debugger and i can see that it is picking up
the right printer from PrinterSettings.InstalledPrinters. I can change to
other fonts that are installed for the default printer and it prints in
those fonts. I just can''t change to a font for the Zebra printer even
though i set the PrinterSettings.PrinterName to the Zebra printer.

How do i change to the font that is only associated with the printer that
i am trying to use ?

Any help would be gratefully appreciated.

Thanks,
Tony



Hello vbnetdev。


根据要求,这是我使用的代码:


Dim labelPrintDocument As New PrintDocument

labelPrintDocument = Me.barcodeLabelPrintDocument


labelPrintDocument.PrinterSettings.PrinterName =

PrinterSettings.InstalledPrinters.Item(0).ToString


如果是labelPrintDocument .PrinterSettings.IsValid然后

Dim y As String

y = labelPrintDocument.DocumentName

结束如果


drawingPrintFont = New Font(Arial Black,12)

barcodePrintFont = New Font(Code 39 Std and Extended,24)

underLinePrintFont = New Font(" Arial Black",10,

System.Drawing.FontStyle .Under)

labelPrintDocument.DefaultPageSettings.Landscape = True


Dim labelDialog As New PrintPreviewDialog

labelDialog.Document = labelPrintDocument

labelDialog.ShowDialog()


谢谢,

Tony


" vbnetdev" < ad *** @ kjmsolutions.comwrote in message

news:ud ************** @ TK2MSFTNGP02.phx.gbl ...
Hello vbnetdev.

As requested, here is the code that i use:

Dim labelPrintDocument As New PrintDocument
labelPrintDocument = Me.barcodeLabelPrintDocument

labelPrintDocument.PrinterSettings.PrinterName =
PrinterSettings.InstalledPrinters.Item(0).ToString

If labelPrintDocument.PrinterSettings.IsValid Then
Dim y As String
y = labelPrintDocument.DocumentName
End If

drawingPrintFont = New Font("Arial Black", 12)
barcodePrintFont = New Font("Code 39 Std and Extended", 24)
underLinePrintFont = New Font("Arial Black", 10,
System.Drawing.FontStyle.Underline)
labelPrintDocument.DefaultPageSettings.Landscape = True

Dim labelDialog As New PrintPreviewDialog
labelDialog.Document = labelPrintDocument
labelDialog.ShowDialog()

Thanks,
Tony

"vbnetdev" <ad***@kjmsolutions.comwrote in message
news:ud**************@TK2MSFTNGP02.phx.gbl...

请显示您为此所做的代码。


" Tony Girgenti" < tony(nospam)@ lakesideos.com写信息

新闻:OS ************** @ TK2MSFTNGP04.phx.gbl ...
Please show your code you are doing for this.
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:OS**************@TK2MSFTNGP04.phx.gbl...

>您好。

在Windows XP Pro上的VS.NET VB,.NET Framework 1.1.4322中开发Windows窗体程序,SP2。

在打印文档之前,我想将字体设置为我打印的打印机只能使用的字体(Zebra TLP2844)。

当我打开Word并查看默认打印机可用的字体时,
它不会显示我想要的字体。如果我将打印机更改为具有我想要的字体的打印机,我想要的字体显示在
字体选择中。这似乎适用于允许我选择打印字体(Excel,记事本等)的任何程序。

在我的VB程序中,我将PrinterSettings.PrinterName属性设置为
具有我想要打印的字体的打印机的名称。
之后我将打印字体设置为我想要的字体,这与打印机在PrinterSettings.PrinterName中相关联。

当我去打印时,它不使用我期待的字体。它使用Microsoft Sans Serif和Microsoft Sans Serif。字体。

我已经通过调试器,我可以看到它正在从PrinterSettings.InstalledPrinters中选择正确的打印机。我可以将
更改为为默认打印机安装的其他字体,并以这些字体打印
。即使我将PrinterSettings.PrinterName设置为Zebra打印机,我也无法更改为Zebra打印机的字体。

如何更改为仅关联的字体我想尝试使用的打印机吗?

感谢任何帮助。

谢谢,
Tony

>Hello.

Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322
on a windows XP Pro, SP2.

Before printing a document, i want to set the font to a font that is only
available with the printer that i am printing to(Zebra TLP2844).

When i open Word and look at the fonts available for the default printer,
it does not show the fonts i want. If i cahnge the printer to the
printer that has the font that i want, the font i want shows up in the
font selections. This seems to be true for any program that allows me to
select a font for printing (Excel, Notepad, etc.)

In my VB program i set the PrinterSettings.PrinterName property to the
name of the printer that has the fonts that i want to print with. After
that i set the print font to the font i want, which is associated with
the printer in PrinterSettings.PrinterName.

When i go to print, it does not use the font that i am expecting. It
uses the "Microsoft Sans Serif" font.

I have taken it through the debugger and i can see that it is picking up
the right printer from PrinterSettings.InstalledPrinters. I can change
to other fonts that are installed for the default printer and it prints
in those fonts. I just can''t change to a font for the Zebra printer even
though i set the PrinterSettings.PrinterName to the Zebra printer.

How do i change to the font that is only associated with the printer that
i am trying to use ?

Any help would be gratefully appreciated.

Thanks,
Tony




我相信Visual Basic .NET只支持TrueType和OpenType字体。

Tony Girgenti < tony(nospam)@ lakesideos.com写信息

新闻:OS ************** @ TK2MSFTNGP04.phx.gbl ...
I believe that Visual Basic .NET supports only TrueType and OpenType fonts.
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:OS**************@TK2MSFTNGP04.phx.gbl...

Hello。


在VS.NET VB,.NET Framework 1.1.4322上开发Windows窗体程序

a windows XP Pro,SP2。


在打印文档之前,我想将字体设置为打印机可用的字体,而不是
我打印到(Zebra TLP2844)。


当我打开Word并查看默认打印机可用的字体时,

它不显示字体我想要。如果我将打印机更换为具有我想要的字体的打印机

,我想要的字体显示为字体

选择。这似乎适用于任何允许我选择

a字体进行打印的程序(Excel,记事本等)


在我的VB程序中我设置PrinterSettings.PrinterName属性为具有我想要打印的字体的打印机的

名称。在

之后,我将打印字体设置为我想要的字体,该字体与PrinterSettings.PrinterName中的

打印机相关联。


当我去打印时,它不使用我期望的字体。它使用

Microsoft Sans Serif字体。


我已通过调试器,我可以看到它正在从PrinterSettings.InstalledPrinters中选择正确的打印机。我可以更改为

为默认打印机安装的其他字体,它打印在

这些字体中。虽然我将PrinterSettings.PrinterName设置为Zebra打印机,但我无法更改为Zebra打印机的字体




我如何更改为仅与打印机相关联的字体

i尝试使用?


任何帮助都将非常感激。


谢谢,

Tony

Hello.

Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on
a windows XP Pro, SP2.

Before printing a document, i want to set the font to a font that is only
available with the printer that i am printing to(Zebra TLP2844).

When i open Word and look at the fonts available for the default printer,
it does not show the fonts i want. If i cahnge the printer to the printer
that has the font that i want, the font i want shows up in the font
selections. This seems to be true for any program that allows me to select
a font for printing (Excel, Notepad, etc.)

In my VB program i set the PrinterSettings.PrinterName property to the
name of the printer that has the fonts that i want to print with. After
that i set the print font to the font i want, which is associated with the
printer in PrinterSettings.PrinterName.

When i go to print, it does not use the font that i am expecting. It uses
the "Microsoft Sans Serif" font.

I have taken it through the debugger and i can see that it is picking up
the right printer from PrinterSettings.InstalledPrinters. I can change to
other fonts that are installed for the default printer and it prints in
those fonts. I just can''t change to a font for the Zebra printer even
though i set the PrinterSettings.PrinterName to the Zebra printer.

How do i change to the font that is only associated with the printer that
i am trying to use ?

Any help would be gratefully appreciated.

Thanks,
Tony



这篇关于分配PrinterName后打印字体不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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