XpsFontSerializationService.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Print / Reach / Serialization / XpsFontSerializationService.cs / 1 / XpsFontSerializationService.cs

                            /*++ 

    Copyright (C) 2004 - 2005 Microsoft Corporation
    All rights reserved.
 
    Module Name:
        XpsFontSerializationService.cs 
 
    Abstract:
        This file implements the XpsFontSerializationService 
        used by the Xps Serialization APIs for serializing
        fonts to a Xps package.

    Author: 
        [....] ([....]) 1-December-2004
 
    Revision History: 
    07/12/2005: [....]: Reach -> Xps
--*/ 

using System;
using System.Windows.Documents;
using System.Windows.Media; 

namespace System.Windows.Xps.Serialization 
{ 
    /// 
    /// This class implements a support service for serialization 
    /// of fonts to a Xps package.
    /// 
    internal class XpsFontSerializationService
    { 
        /// 
        ///  
        public 
        XpsFontSerializationService(
            BasePackagingPolicy packagingPolicy 
            )
        {

            _fontSubsetter = new XpsFontSubsetter(packagingPolicy);
        } 

        public 
        bool 
        SignalCommit( Type type )
        { 
            FontSubsetterCommitPolicies signal;
            if(type == typeof(FixedDocumentSequence))
            {
                signal = FontSubsetterCommitPolicies.CommitEntireSequence; 
            }
            else if(type ==  typeof(FixedDocument)) 
            { 
                signal = FontSubsetterCommitPolicies.CommitPerDocument;
            } 
            else if(type== typeof(FixedPage))
            {
                signal = FontSubsetterCommitPolicies.CommitPerPage;
            } 
            else if(type == typeof(Visual))
            { 
                signal = FontSubsetterCommitPolicies.CommitPerPage; 
            }
            else 
            {
                throw new XpsSerializationException(ReachSR.Get(ReachSRID.ReachSerialization_NotSupported));
            }
            return _fontSubsetter.CommitFontSubsetsSignal(signal); 
        }
 
        ///  
        /// This method retieves a XpsFontSubsetter for
        /// serializing a font to a Xps package. 
        /// This method assumes the font subsetter
        /// has already been itialized.
        /// 
        ///  
        /// A reference to a XpsFontSubsetter instance.
        ///  
        public 
        XpsFontSubsetter
        FontSubsetter 
        {
            get
            {
                return _fontSubsetter; 
            }
        } 
 
        private XpsFontSubsetter _fontSubsetter;
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK