Manages fonts across the presentation. More...

Inherits Aspose::Slides::IFontsManager.

Public Member Functions

System::SharedPtr< Aspose::Slides::IFontSubstRuleCollectionget_FontSubstRuleList ()
 Font substitutions to use when rendering. Read IFontSubstRuleCollection. More...
 
void set_FontSubstRuleList (System::SharedPtr< Aspose::Slides::IFontSubstRuleCollection > value)
 Font substitutions to use when rendering. Write IFontSubstRuleCollection. More...
 
System::SharedPtr< Aspose::Slides::IFontFallBackRulesCollectionget_FontFallBackRulesCollection ()
 Represents a user's collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality

auto pres = MakeObject<Presentation>();
// Getting of empty or preinitialized rules collection from FontsManager
auto rulesList = pres->get_FontsManager()->get_FontFallBackRulesCollection();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// or
// initialization of new instance of rules collection
auto rulesList = MakeObject<FontFallBackRulesCollection>();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// and replacing of existing collection by the new one in FontsManager
pres->get_FontsManager()->set_FontFallBackRulesCollection(rulesList);

Read IFontFallBackRulesCollection. More...

 
void set_FontFallBackRulesCollection (System::SharedPtr< Aspose::Slides::IFontFallBackRulesCollection > value)
 Represents a user's collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality

auto pres = MakeObject<Presentation>();
// Getting of empty or preinitialized rules collection from FontsManager
auto rulesList = pres->get_FontsManager()->get_FontFallBackRulesCollection();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// or
// initialization of new instance of rules collection
auto rulesList = MakeObject<FontFallBackRulesCollection>();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// and replacing of existing collection by the new one in FontsManager
pres->get_FontsManager()->set_FontFallBackRulesCollection(rulesList);

Write IFontFallBackRulesCollection. More...

 
System::ArrayPtr< System::SharedPtr< Aspose::Slides::IFontData > > GetFonts ()
 Returns the fonts used in the presentation More...
 
System::ArrayPtr< System::SharedPtr< Aspose::Slides::IFontData > > GetEmbeddedFonts ()
 Returns the fonts embedded in the presentation More...
 
void RemoveEmbeddedFont (System::SharedPtr< Aspose::Slides::IFontData > fontData)
 Removes the embedded font More...
 
void AddEmbeddedFont (System::SharedPtr< Aspose::Slides::IFontData > fontData, Aspose::Slides::Export::EmbedFontCharacters embedFontRule)
 Adds the embedded font More...
 
void AddEmbeddedFont (System::ArrayPtr< uint8_t > fontData, Aspose::Slides::Export::EmbedFontCharacters embedFontRule)
 Adds the embedded font More...
 
void ReplaceFont (System::SharedPtr< Aspose::Slides::IFontData > sourceFont, System::SharedPtr< Aspose::Slides::IFontData > destFont)
 Replace font in presentation More...
 
void ReplaceFont (System::SharedPtr< Aspose::Slides::IFontSubstRule > substRule)
 Replace font in presentation using information provided in FontSubstRule More...
 
void ReplaceFont (System::SharedPtr< Aspose::Slides::IFontSubstRuleCollection > substRules)
 Replace font in presentation using information provided in collection of FontSubstRule More...
 
- Public Member Functions inherited from Aspose::Slides::IFontsManager
virtual void set_FontSubstRuleList (System::SharedPtr< IFontSubstRuleCollection > value)=0
 Font substitutions to use when rendering Write IFontSubstRuleCollection. More...
 
virtual void set_FontFallBackRulesCollection (System::SharedPtr< IFontFallBackRulesCollection > value)=0
 Represents a user's collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality

auto pres = MakeObject<Presentation>();
// Getting of empty or preinitialized rules collection from FontsManager
auto rulesList = pres->get_FontsManager()->get_FontFallBackRulesCollection();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// or
// initialization of new instance of rules collection
auto rulesList = MakeObject<FontFallBackRulesCollection>();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// and replacing of existing collection by the new one in FontsManager
pres->get_FontsManager()->set_FontFallBackRulesCollection(rulesList);

Write IFontFallBackRulesCollection. More...

 
virtual void RemoveEmbeddedFont (System::SharedPtr< IFontData > fontData)=0
 Removes the embedded font More...
 
virtual void AddEmbeddedFont (System::SharedPtr< IFontData > fontData, Export::EmbedFontCharacters embedFontRule)=0
 Adds the embedded font. More...
 
virtual void ReplaceFont (System::SharedPtr< IFontData > sourceFont, System::SharedPtr< IFontData > destFont)=0
 Replace font in presentation More...
 
virtual void ReplaceFont (System::SharedPtr< IFontSubstRule > substRule)=0
 Replace font in presentation using information provided in IFontSubstRule More...
 
virtual void ReplaceFont (System::SharedPtr< IFontSubstRuleCollection > substRules)=0
 Replace font in presentation using information provided in collection of IFontSubstRule 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...
 
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)
 

Protected Member Functions

bool get_UseFontsSubstitutionsList ()
 Allow to set on/off of fonts substituition list mode Font substitutions list using for rendering More...
 
void set_UseFontsSubstitutionsList (bool value)
 Allow to set on/off of fonts substituition list mode Font substitutions list using for rendering More...
 
System::SharedPtr< Aspose::Slides::FontsList > get_FontsList ()
 
System::SharedPtr< Aspose::Slides::FontsManagerInternal > get_ManagerInternal ()
 
 FontsManager (System::SharedPtr< Aspose::Slides::FontsManagerInternal > fontsManagerInternal, System::SharedPtr< Aspose::Slides::FontsList > fontsList, System::SharedPtr< Aspose::Slides::IPresentation > owner)
 
System::SharedPtr< Aspose::Slides::Util::FontWrapper > GetFontWrapperStub (System::SharedPtr< Aspose::Slides::FontData > font)
 
void AddEmbeddedFontsFrom (System::SharedPtr< Aspose::Slides::FontsManager > fontsManager)
 
System::ArrayPtr< uint8_t > SubsetFont (System::ArrayPtr< uint8_t > fontBytes)
 
System::SharedPtr< System::Collections::Generic::IDictionary< System::Drawing::FontStyle, System::ArrayPtr< uint8_t > > > SubsetFont (System::SharedPtr< Aspose::Slides::EmbeddedFont > embeddedFont)
 
System::SharedPtr< Aspose::Slides::FontsManagerRenderingGuard > StartRendering ()
 

Static Protected Member Functions

static System::ArrayPtr< uint8_t > ConvertToEot (System::ArrayPtr< uint8_t > fontBytes, System::SharedPtr< Aspose::Slides::FontData > &fontData)
 
static System::SharedPtr< Aspose::Fonts::TTF::TTFFont > LoadFont (System::ArrayPtr< uint8_t > fontBytes)
 
static System::SharedPtr< Aspose::Common::TrueType::TTFont > LoadTTFont (System::ArrayPtr< uint8_t > fontBytes, System::String fontName)
 
static System::ArrayPtr< uint8_t > GetTrueTypeFontData (System::ArrayPtr< uint8_t > eotFontData)
 
static System::Drawing::FontStyle Convert (Aspose::Fonts::Common::FontStyle fontStyle)
 
static System::Drawing::FontStyle Convert (System::String fontStyle)
 Converts string representation of font style to FontStyle according to the rules described in OpenType "name" (Naming Table) specification (https://www.microsoft.com/typography/otspec/name.htm") More...
 

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

Detailed Description

Manages fonts across the presentation.

Constructor & Destructor Documentation

◆ FontsManager()

Aspose::Slides::FontsManager::FontsManager ( System::SharedPtr< Aspose::Slides::FontsManagerInternal >  fontsManagerInternal,
System::SharedPtr< Aspose::Slides::FontsList >  fontsList,
System::SharedPtr< Aspose::Slides::IPresentation owner 
)
protected

Member Function Documentation

◆ AddEmbeddedFont() [1/2]

void Aspose::Slides::FontsManager::AddEmbeddedFont ( System::SharedPtr< Aspose::Slides::IFontData fontData,
Aspose::Slides::Export::EmbedFontCharacters  embedFontRule 
)

Adds the embedded font

Keep in mind when copying any fonts that most fonts are copyrighted. First locate the license of a font before hand and verify they can be freely transferred to another machine.

Exceptions
System::ArgumentExceptionAn ArgumentException can be thrown if font data is null or this font is already embedded

◆ AddEmbeddedFont() [2/2]

void Aspose::Slides::FontsManager::AddEmbeddedFont ( System::ArrayPtr< uint8_t >  fontData,
Aspose::Slides::Export::EmbedFontCharacters  embedFontRule 
)
virtual

Adds the embedded font

Keep in mind when copying any fonts that most fonts are copyrighted. First locate the license of a font before hand and verify they can be freely transferred to another machine.

Exceptions
System::ArgumentExceptionAn ArgumentException can be thrown if font data is null or this font is already embedded

Implements Aspose::Slides::IFontsManager.

◆ AddEmbeddedFontsFrom()

void Aspose::Slides::FontsManager::AddEmbeddedFontsFrom ( System::SharedPtr< Aspose::Slides::FontsManager fontsManager)
protected

◆ Convert() [1/2]

static System::Drawing::FontStyle Aspose::Slides::FontsManager::Convert ( Aspose::Fonts::Common::FontStyle  fontStyle)
staticprotected

◆ Convert() [2/2]

static System::Drawing::FontStyle Aspose::Slides::FontsManager::Convert ( System::String  fontStyle)
staticprotected

Converts string representation of font style to FontStyle according to the rules described in OpenType "name" (Naming Table) specification (https://www.microsoft.com/typography/otspec/name.htm")

◆ ConvertToEot()

static System::ArrayPtr<uint8_t> Aspose::Slides::FontsManager::ConvertToEot ( System::ArrayPtr< uint8_t >  fontBytes,
System::SharedPtr< Aspose::Slides::FontData > &  fontData 
)
staticprotected

◆ get_FontFallBackRulesCollection()

System::SharedPtr<Aspose::Slides::IFontFallBackRulesCollection> Aspose::Slides::FontsManager::get_FontFallBackRulesCollection ( )
virtual

Represents a user's collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality

auto pres = MakeObject<Presentation>();
// Getting of empty or preinitialized rules collection from FontsManager
auto rulesList = pres->get_FontsManager()->get_FontFallBackRulesCollection();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// or
// initialization of new instance of rules collection
auto rulesList = MakeObject<FontFallBackRulesCollection>();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// and replacing of existing collection by the new one in FontsManager
pres->get_FontsManager()->set_FontFallBackRulesCollection(rulesList);

Read IFontFallBackRulesCollection.

Implements Aspose::Slides::IFontsManager.

◆ get_FontsList()

System::SharedPtr<Aspose::Slides::FontsList> Aspose::Slides::FontsManager::get_FontsList ( )
protected

◆ get_FontSubstRuleList()

System::SharedPtr<Aspose::Slides::IFontSubstRuleCollection> Aspose::Slides::FontsManager::get_FontSubstRuleList ( )
virtual

Font substitutions to use when rendering. Read IFontSubstRuleCollection.

Implements Aspose::Slides::IFontsManager.

◆ get_ManagerInternal()

System::SharedPtr<Aspose::Slides::FontsManagerInternal> Aspose::Slides::FontsManager::get_ManagerInternal ( )
protected

◆ get_UseFontsSubstitutionsList()

bool Aspose::Slides::FontsManager::get_UseFontsSubstitutionsList ( )
protected

Allow to set on/off of fonts substituition list mode Font substitutions list using for rendering

◆ GetEmbeddedFonts()

System::ArrayPtr<System::SharedPtr<Aspose::Slides::IFontData> > Aspose::Slides::FontsManager::GetEmbeddedFonts ( )
virtual

Returns the fonts embedded in the presentation

Implements Aspose::Slides::IFontsManager.

◆ GetFonts()

System::ArrayPtr<System::SharedPtr<Aspose::Slides::IFontData> > Aspose::Slides::FontsManager::GetFonts ( )
virtual

Returns the fonts used in the presentation

Returns
An array of fonts

Implements Aspose::Slides::IFontsManager.

◆ GetFontWrapperStub()

System::SharedPtr<Aspose::Slides::Util::FontWrapper> Aspose::Slides::FontsManager::GetFontWrapperStub ( System::SharedPtr< Aspose::Slides::FontData font)
protected

◆ GetTrueTypeFontData()

static System::ArrayPtr<uint8_t> Aspose::Slides::FontsManager::GetTrueTypeFontData ( System::ArrayPtr< uint8_t >  eotFontData)
staticprotected

◆ LoadFont()

static System::SharedPtr<Aspose::Fonts::TTF::TTFFont> Aspose::Slides::FontsManager::LoadFont ( System::ArrayPtr< uint8_t >  fontBytes)
staticprotected

◆ LoadTTFont()

static System::SharedPtr<Aspose::Common::TrueType::TTFont> Aspose::Slides::FontsManager::LoadTTFont ( System::ArrayPtr< uint8_t >  fontBytes,
System::String  fontName 
)
staticprotected

◆ RemoveEmbeddedFont()

void Aspose::Slides::FontsManager::RemoveEmbeddedFont ( System::SharedPtr< Aspose::Slides::IFontData fontData)

Removes the embedded font

◆ ReplaceFont() [1/3]

void Aspose::Slides::FontsManager::ReplaceFont ( System::SharedPtr< Aspose::Slides::IFontData sourceFont,
System::SharedPtr< Aspose::Slides::IFontData destFont 
)

Replace font in presentation

Parameters
sourceFontSource font
destFontDestination font

◆ ReplaceFont() [2/3]

void Aspose::Slides::FontsManager::ReplaceFont ( System::SharedPtr< Aspose::Slides::IFontSubstRule substRule)

Replace font in presentation using information provided in FontSubstRule

Parameters
substRuleFont substitution info

◆ ReplaceFont() [3/3]

void Aspose::Slides::FontsManager::ReplaceFont ( System::SharedPtr< Aspose::Slides::IFontSubstRuleCollection substRules)

Replace font in presentation using information provided in collection of FontSubstRule

Parameters
substRulesFont substitution rules collection

◆ set_FontFallBackRulesCollection()

void Aspose::Slides::FontsManager::set_FontFallBackRulesCollection ( System::SharedPtr< Aspose::Slides::IFontFallBackRulesCollection value)

Represents a user's collection of FontFallBack rules for managing of collections of fonts for proper substitutions by fallback functionality

auto pres = MakeObject<Presentation>();
// Getting of empty or preinitialized rules collection from FontsManager
auto rulesList = pres->get_FontsManager()->get_FontFallBackRulesCollection();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// or
// initialization of new instance of rules collection
auto rulesList = MakeObject<FontFallBackRulesCollection>();
// adding of rules to collection
rulesList->Add(MakeObject<FontFallBackRule>(0x400, 0x4FF, u"Times New Roman"));
// and replacing of existing collection by the new one in FontsManager
pres->get_FontsManager()->set_FontFallBackRulesCollection(rulesList);

Write IFontFallBackRulesCollection.

◆ set_FontSubstRuleList()

void Aspose::Slides::FontsManager::set_FontSubstRuleList ( System::SharedPtr< Aspose::Slides::IFontSubstRuleCollection value)

Font substitutions to use when rendering. Write IFontSubstRuleCollection.

◆ set_UseFontsSubstitutionsList()

void Aspose::Slides::FontsManager::set_UseFontsSubstitutionsList ( bool  value)
protected

Allow to set on/off of fonts substituition list mode Font substitutions list using for rendering

◆ StartRendering()

System::SharedPtr<Aspose::Slides::FontsManagerRenderingGuard> Aspose::Slides::FontsManager::StartRendering ( )
protected

◆ SubsetFont() [1/2]

System::ArrayPtr<uint8_t> Aspose::Slides::FontsManager::SubsetFont ( System::ArrayPtr< uint8_t >  fontBytes)
protected

◆ SubsetFont() [2/2]

System::SharedPtr<System::Collections::Generic::IDictionary<System::Drawing::FontStyle, System::ArrayPtr<uint8_t> > > Aspose::Slides::FontsManager::SubsetFont ( System::SharedPtr< Aspose::Slides::EmbeddedFont >  embeddedFont)
protected