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

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

#include <Aspose.Words.Cpp/Model/Fonts/FontSettings.h>

+ Inheritance diagram for Aspose::Words::Fonts::FontSettings:

Public Member Functions

 FontSettings ()
 
SharedPtr< FontFallbackSettingsget_FallbackSettings () const
 Settings related to font fallback mechanism. More...
 
SharedPtr< FontSubstitutionSettingsget_SubstitutionSettings () const
 Settings related to font substitution mechanism. More...
 
ArrayPtr< SharedPtr< 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...
 
void SetFontsFolder (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 SetFontsFolders for setting only one font directory. More...
 
void SetFontsFolders (ArrayPtr< String > fontsFolders, bool recursive)
 Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. More...
 
void SetFontsSources (ArrayPtr< SharedPtr< FontSourceBase >> sources)
 Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Static Public Member Functions

static SharedPtr< FontSettingsget_DefaultInstance ()
 Static default font settings. More...
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 

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 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 SetFontsSources 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 SetFontsFolders 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.