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:

  • 做為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屬性設定為UnknownYou should never set a PrintTicket property to Unknown. 如果某些其他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.

PrintCapabilities PrintTicket 雖然無法繼承PrintCapabilities和類別, 但是您可以擴充列印架構, 以辨識或類別中未納入的列印裝置功能。 PrintTicketAlthough 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.

適用於

另請參閱