TrueTypeFontMode 枚举

定义

指定打印机对格式为 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
继承
TrueTypeFontMode

字段

Automatic 1

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

DownloadAsNativeTrueTypeFont 4

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

DownloadAsOutlineFont 2

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

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 5

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

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:

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.

PrintTicket PrintCapabilities尽管和PrintTicket PrintCapabilities类不能被继承, 但你可以扩展打印架构来识别在或类中不考虑的打印设备功能。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.

适用于

另请参阅