Export (0) Print
Expand All
Expand Minimize

TrueTypeFontMode Enumeration

Specifies how a printer handles text that is formatted with a TrueType font.

Namespace:  System.Printing
Assembly:  ReachFramework (in ReachFramework.dll)

public enum TrueTypeFontMode
<object property="enumerationMemberName" .../>

Member nameDescription
AutomaticThe printer driver decides the best method for handling TrueType fonts.
DownloadAsNativeTrueTypeFontThe printer driver downloads the TrueType font.
DownloadAsOutlineFontThe printer driver downloads the TrueType font as an outline font.
DownloadAsRasterFontThe printer driver creates a raster font for each size of the TrueType font that it needs and downloads them all.
RenderAsBitmapThe printer driver downloads each area of text as a graphic.
UnknownThe feature (whose options are represented by this enumeration) is set to an option not defined. in the Print Schema.

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. Also, some printers do not support TrueType fonts.

Newer printers often avoid these problems by doing the following.

  • Converting a TrueType font into an outline font, which is a generic vector font. Many printers that do not support TrueType fonts, do support outline fonts.

  • 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. 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:

  • 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.

  • As the value of the TrueTypeFontMode property of a PrintTicket, the value instructs the printer to handle TrueType fonts in a particular way.

The Unknown value is never used in properties of PrintCapabilities objects.

You should never set a PrintTicket property to Unknown. 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.

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.

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> 
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()

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft