Aspose::Words::Fonts::FontSettings Class Reference

Specifies font settings for a document. More...

#include "Aspose.Words.Cpp/Model/Fonts/FontSettings.h"

Inherits System::Object.

Public Member Functions

System::SharedPtr< Aspose::Words::Fonts::FontFallbackSettingsget_FallbackSettings () const
 Settings related to font fallback mechanism. More...
 
System::SharedPtr< Aspose::Words::Fonts::FontSubstitutionSettingsget_SubstitutionSettings () const
 Settings related to font substitution mechanism. More...
 
 FontSettings ()
 
void SetFontsFolder (System::String fontFolder, bool recursive)
 Sets the folder where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. This is a shortcut to Aspose::Words::Fonts::FontSettings::SetFontsFolders(System::ArrayPtr<System::String>, bool) for setting only one font directory. More...
 
void SetFontsFolders (System::ArrayPtr< System::String > fontsFolders, bool recursive)
 Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. More...
 
void SetFontsSources (System::ArrayPtr< System::SharedPtr< Aspose::Words::Fonts::FontSourceBase >> sources)
 Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. More...
 
System::ArrayPtr< System::SharedPtr< Aspose::Words::Fonts::FontSourceBase > > GetFontsSources ()
 Gets a copy of the array that contains the list of sources where Aspose.Words looks for TrueType fonts. More...
 
void ResetFontSources ()
 Resets the fonts sources to the system default. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 

Static Public Member Functions

static System::SharedPtr< Aspose::Words::Fonts::FontSettingsget_DefaultInstance ()
 Static default font settings. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

Specifies font settings for a document.

Aspose.Words uses font settings to resolve the fonts in the document. Fonts are resolved mostly when building document layout or rendering to fixed page formats. But when loading some formats, Aspose.Words also may require to resolve the fonts. For example, when loading HTML documents Aspose.Words may resolve the fonts to perform font fallback. So it is recommended that you set the font settings in Aspose::Words::LoadOptions when loading the document. Or at least before building the layout or rendering the document to the fixed-page format.

By default all documents uses single static font settings instance. It could be accessed by Aspose::Words::Fonts::FontSettings::get_DefaultInstance property.

Changing font settings is safe at any time from any thread. But it is recommended that you do not change the font settings while processing some documents which uses this settings. This can lead to the fact that the same font will be resolved differently in different parts of the document.

Constructor & Destructor Documentation

◆ FontSettings()

Aspose::Words::Fonts::FontSettings::FontSettings ( )

Member Function Documentation

◆ get_DefaultInstance()

static System::SharedPtr<Aspose::Words::Fonts::FontSettings> Aspose::Words::Fonts::FontSettings::get_DefaultInstance ( )
static

Static default font settings.

This instance is used by default in a document unless Aspose::Words::Document::get_FontSettings is specified.

◆ get_FallbackSettings()

System::SharedPtr<Aspose::Words::Fonts::FontFallbackSettings> Aspose::Words::Fonts::FontSettings::get_FallbackSettings ( ) const

Settings related to font fallback mechanism.

◆ get_SubstitutionSettings()

System::SharedPtr<Aspose::Words::Fonts::FontSubstitutionSettings> Aspose::Words::Fonts::FontSettings::get_SubstitutionSettings ( ) const

Settings related to font substitution mechanism.

◆ GetFontsSources()

System::ArrayPtr<System::SharedPtr<Aspose::Words::Fonts::FontSourceBase> > Aspose::Words::Fonts::FontSettings::GetFontsSources ( )

Gets a copy of the array that contains the list of sources where Aspose.Words looks for TrueType fonts.

The returned value is a copy of the data that Aspose.Words uses. If you change the entries in the returned array, it will have no effect on document rendering. To specify new font sources use the Aspose::Words::Fonts::FontSettings::SetFontsSources(System::ArrayPtr<System::SharedPtr<Aspose::Words::Fonts::FontSourceBase>>) method.

Returns
A copy of the current font sources.

◆ ResetFontSources()

void Aspose::Words::Fonts::FontSettings::ResetFontSources ( )

Resets the fonts sources to the system default.

◆ SetFontsFolder()

void Aspose::Words::Fonts::FontSettings::SetFontsFolder ( System::String  fontFolder,
bool  recursive 
)

Sets the folder where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. This is a shortcut to Aspose::Words::Fonts::FontSettings::SetFontsFolders(System::ArrayPtr<System::String>, bool) for setting only one font directory.

Parameters
fontFolderThe folder that contains TrueType fonts.
recursiveTrue to scan the specified folders for fonts recursively.

◆ SetFontsFolders()

void Aspose::Words::Fonts::FontSettings::SetFontsFolders ( System::ArrayPtr< System::String fontsFolders,
bool  recursive 
)

Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.

By default, Aspose.Words looks for fonts installed to the system.

Setting this property resets the cache of all previously loaded fonts.

Parameters
fontsFoldersAn array of folders that contain TrueType fonts.
recursiveTrue to scan the specified folders for fonts recursively.

◆ SetFontsSources()

void Aspose::Words::Fonts::FontSettings::SetFontsSources ( System::ArrayPtr< System::SharedPtr< Aspose::Words::Fonts::FontSourceBase >>  sources)

Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.

By default, Aspose.Words looks for fonts installed to the system.

Setting this property resets the cache of all previously loaded fonts.

Parameters
sourcesAn array of sources that contain TrueType fonts.