TrueTypeFontMode TrueTypeFontMode TrueTypeFontMode TrueTypeFontMode Enum

定义

指定打印机对格式为 TrueType 字体的文本的处理方式。Specifies how a printer handles text that is formatted with a TrueType font.

public enum class TrueTypeFontMode
public enum TrueTypeFontMode
type TrueTypeFontMode = 
Public Enum TrueTypeFontMode
继承
TrueTypeFontModeTrueTypeFontModeTrueTypeFontModeTrueTypeFontMode

字段

Automatic Automatic Automatic Automatic 1

打印机驱动程序决定处理 TrueType 字体的最好方式。The printer driver decides the best method for handling TrueType fonts.

DownloadAsNativeTrueTypeFont DownloadAsNativeTrueTypeFont DownloadAsNativeTrueTypeFont DownloadAsNativeTrueTypeFont 4

打印机驱动程序下载 TrueType 字体。The printer driver downloads the TrueType font.

DownloadAsOutlineFont DownloadAsOutlineFont DownloadAsOutlineFont DownloadAsOutlineFont 2

打印机驱动程序将 TrueType 字体作为轮廓字体下载。The printer driver downloads the TrueType font as an outline font.

DownloadAsRasterFont DownloadAsRasterFont DownloadAsRasterFont DownloadAsRasterFont 3

打印机驱动程序为 TrueType 字体的各个字号创建其所需要的光栅字体,并全部下载。The printer driver creates a raster font for each size of the TrueType font that it needs and downloads them all.

RenderAsBitmap RenderAsBitmap RenderAsBitmap RenderAsBitmap 5

打印机驱动程序将文本的各个区域作为图形下载。The printer driver downloads each area of text as a graphic.

Unknown Unknown Unknown Unknown 0

将此功能(其选项由此枚举表示)设置为未在中定义的选项。The feature (whose options are represented by this enumeration) is set to an option not defined. 打印架构中。in the Print Schema.

示例

下面的示例演示如何测试打印机的功能和配置打印的作业,以充分利用它们。The following example shows how to test a printer's capabilities and configure the print job to take advantage of them.

// ---------------------- GetPrintTicketFromPrinter -----------------------
/// <summary>
///   Returns a PrintTicket based on the current default printer.</summary>
/// <returns>
///   A PrintTicket for the current local default printer.</returns>
PrintTicket^ GetPrintTicketFromPrinter () 
{
   PrintQueue^ printQueue = nullptr;

   LocalPrintServer^ localPrintServer = gcnew LocalPrintServer();

   // Retrieving collection of local printer on user machine
   PrintQueueCollection^ localPrinterCollection = localPrintServer->GetPrintQueues();

   System::Collections::IEnumerator^ localPrinterEnumerator = localPrinterCollection->GetEnumerator();

   if (localPrinterEnumerator->MoveNext())
   {
      // Get PrintQueue from first available printer
      printQueue = ((PrintQueue^)localPrinterEnumerator->Current);
   } else
   {
      return nullptr;
   }
   // Get default PrintTicket from printer
   PrintTicket^ printTicket = printQueue->DefaultPrintTicket;

   PrintCapabilities^ printCapabilites = printQueue->GetPrintCapabilities();

   // Modify PrintTicket
   if (printCapabilites->CollationCapability->Contains(Collation::Collated))
   {
      printTicket->Collation = Collation::Collated;
   }
   if (printCapabilites->DuplexingCapability->Contains(Duplexing::TwoSidedLongEdge))
   {
      printTicket->Duplexing = Duplexing::TwoSidedLongEdge;
   }
   if (printCapabilites->StaplingCapability->Contains(Stapling::StapleDualLeft))
   {
      printTicket->Stapling = Stapling::StapleDualLeft;
   }
   return printTicket;
};// end:GetPrintTicketFromPrinter()
// ---------------------- GetPrintTicketFromPrinter -----------------------
/// <summary>
///   Returns a PrintTicket based on the current default printer.</summary>
/// <returns>
///   A PrintTicket for the current local default printer.</returns>
private PrintTicket GetPrintTicketFromPrinter()
{
    PrintQueue printQueue = null;

    LocalPrintServer localPrintServer = new LocalPrintServer();

    // Retrieving collection of local printer on user machine
    PrintQueueCollection localPrinterCollection =
        localPrintServer.GetPrintQueues();

    System.Collections.IEnumerator localPrinterEnumerator =
        localPrinterCollection.GetEnumerator();

    if (localPrinterEnumerator.MoveNext())
    {
        // Get PrintQueue from first available printer
        printQueue = (PrintQueue)localPrinterEnumerator.Current;
    }
    else
    {
        // No printer exist, return null PrintTicket
        return null;
    }

    // Get default PrintTicket from printer
    PrintTicket printTicket = printQueue.DefaultPrintTicket;

    PrintCapabilities printCapabilites = printQueue.GetPrintCapabilities();

    // Modify PrintTicket
    if (printCapabilites.CollationCapability.Contains(Collation.Collated))
    {
        printTicket.Collation = Collation.Collated;
    }

    if ( printCapabilites.DuplexingCapability.Contains(
            Duplexing.TwoSidedLongEdge) )
    {
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge;
    }

    if (printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft))
    {
        printTicket.Stapling = Stapling.StapleDualLeft;
    }

    return printTicket;
}// end:GetPrintTicketFromPrinter()
' ---------------------- GetPrintTicketFromPrinter -----------------------
''' <summary>
'''   Returns a PrintTicket based on the current default printer.</summary>
''' <returns>
'''   A PrintTicket for the current local default printer.</returns>
Private Function GetPrintTicketFromPrinter() As PrintTicket
    Dim printQueue As PrintQueue = Nothing

    Dim localPrintServer As New LocalPrintServer()

    ' Retrieving collection of local printer on user machine
    Dim localPrinterCollection As PrintQueueCollection = localPrintServer.GetPrintQueues()

    Dim localPrinterEnumerator As System.Collections.IEnumerator = localPrinterCollection.GetEnumerator()

    If localPrinterEnumerator.MoveNext() Then
        ' Get PrintQueue from first available printer
        printQueue = CType(localPrinterEnumerator.Current, PrintQueue)
    Else
        ' No printer exist, return null PrintTicket
        Return Nothing
    End If

    ' Get default PrintTicket from printer
    Dim printTicket As PrintTicket = printQueue.DefaultPrintTicket

    Dim printCapabilites As PrintCapabilities = printQueue.GetPrintCapabilities()

    ' Modify PrintTicket
    If printCapabilites.CollationCapability.Contains(Collation.Collated) Then
        printTicket.Collation = Collation.Collated
    End If

    If printCapabilites.DuplexingCapability.Contains(Duplexing.TwoSidedLongEdge) Then
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge
    End If

    If printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft) Then
        printTicket.Stapling = Stapling.StapleDualLeft
    End If

    Return printTicket
End Function ' end:GetPrintTicketFromPrinter()

注解

TrueType 字体向量字体,它指示打印机驱动程序和屏幕驱动程序如何绘制字母的形状和填充它们。TrueType fonts are vector fonts, which instruct printer drivers and screen drivers how to draw the shapes of the letters and fill them in. 与之相反的矢量字体光栅字体,它是只需列表。Vector fonts contrast with raster fonts, which are simply lists. 光栅字体具有每个字母的每个可用的字号,列表和列表确定是否要打印的信中的每个像素。A raster font has a list for each letter of each available font size, and the lists determine, for every pixel in the letter, whether it prints.

您可以放大或缩小到几乎任意点大小; 的矢量字体但是,因为它们将占用大量的打印机内存矢量字体可能会降低打印。You can enlarge or reduce vector fonts to almost any point size; however, vector fonts can slow printing because they occupy a large amount of printer memory. 此外,某些打印机不支持 TrueType 字体。Also, some printers do not support TrueType fonts.

较新的打印机通常通过执行以下操作避免这些问题。Newer printers often avoid these problems by doing the following.

  • 将 TrueType 字体转换成轮廓字体,这是一种通用的矢量字体。Converting a TrueType font into an outline font, which is a generic vector font. 不支持 TrueType 字体的许多打印机支持矢量字。Many printers that do not support TrueType fonts, do support outline fonts.

  • 创建临时光栅字体看上去如同 TrueType 字体。Creating a temporary raster font that looks just like a TrueType font. 打印机必须创建每个文档使用的字体大小的单独临时光栅字体。The printer must create a separate temporary raster font for each font size that the document uses. 出于此原因,如果打印作业使用许多字体大小,打印机使用的总内存可能会比 TrueType 字体更高版本。For that reason, if a print job uses many font sizes, the total memory that the printer uses might be greater than what a TrueType font would use.

  • 在文档中的每个文本区域视为一个图形。Treating each text area in the document as a graphic. 如果设备需要包含很少文本对文档进行打印,下载的文本作为一个图形可以使用更少比下载字体的打印机内存。If a device needs to print a document that contains very little text, downloading text as a graphic can use less printer memory than downloading a font.

出于这些目的使用此类型的值:Use the values of this type for these purposes:

  • 作为的成员TrueTypeFontModeCapability回收,这是一个属性的PrintCapabilities,这些值指示其以前的技术可用于在特定打印机。As members of the TrueTypeFontModeCapability collection, which is a property of PrintCapabilities, these values indicate which of the preceding techniques is available for a particular printer. 许多打印机支持多个以下方法之一。Many printers support more than one of these techniques.

  • 值作为TrueTypeFontMode属性的PrintTicket,该值指示打印机以特定方式处理 TrueType 字体。As the value of the TrueTypeFontMode property of a PrintTicket, the value instructs the printer to handle TrueType fonts in a particular way.

未知属性中永远不会使用值PrintCapabilities对象。The Unknown value is never used in properties of PrintCapabilities objects.

绝不应设置PrintTicket属性设置为未知You should never set a PrintTicket property to Unknown. 如果某一其他PrintTicket生成应用程序已创建PrintTicket 文档TrueType 字体处理功能设置为无法识别的选项 (即,未在中定义的选项打印架构,然后PrintTicket使用该文档构造应用程序中的对象将具有未知的值作为TrueTypeFontMode属性。If some other PrintTicket producing application has created a PrintTicket document that sets the TrueType font handling feature to an unrecognized option (that is, an option that is not defined in the Print Schema, then a PrintTicket object in your application that is constructed with that document will have Unknown as the value of the TrueTypeFontMode property.

尽管PrintTicketPrintCapabilities类不能被继承,可以扩展打印架构识别并不表示中的打印设备功能PrintTicketPrintCapabilities类。Although the PrintTicket and PrintCapabilities classes cannot be inherited, you can extend the Print Schema to recognize print device features that are not accounted for in the PrintTicket or PrintCapabilities classes. 有关详细信息,请参阅操作说明:扩展的打印架构并创建新的打印系统类For more information see How to: Extend the Print Schema and Create New Print System Classes.

适用于

另请参阅