Represents font object. More...

#include "Font.h"

Inherits System::Object.

Public Member Functions

ASPOSE_PDF_SHARED_API System::String get_FontName () const
 Gets font name of the Font object. More...
 
ASPOSE_PDF_SHARED_API System::String get_DecodedFontName ()
 Sometimes PDF fonts(usually Chinese/Japanese/Korean fonts) could have specificical font name. This name is value of PDF font property "BaseFont" and sometimes this property could be represented in hexademical form. If read this name directly it could be represented in non-readable form. To get readable form it's necessary to decode font's name by rules specifical for this font. This property returns decoded font name, so use it for cases when you meet with a non-readable FontName. If property FontName has readable form this property will be the same as FontName, so you can use this property for any cases when you need to get font name in a readable form. More...
 
ASPOSE_PDF_SHARED_API System::String get_BaseFont ()
 Gets BaseFont value of PDF font object. Also known as PostScript name of the font. More...
 
ASPOSE_PDF_SHARED_API bool get_IsEmbedded () const
 Gets a value that indicates whether the font is embedded. Font based on IFont will automatically be subset and embedded More...
 
ASPOSE_PDF_SHARED_API void set_IsEmbedded (bool value)
 Sets a value that indicates whether the font is embedded. Font based on IFont will automatically be subset and embedded More...
 
ASPOSE_PDF_SHARED_API bool get_IsSubset ()
 Gets a value that indicates whether the font is a subset. Font based on IFont will automatically be subset and embedded More...
 
ASPOSE_PDF_SHARED_API void set_IsSubset (bool value)
 Sets a value that indicates whether the font is a subset. Font based on IFont will automatically be subset and embedded More...
 
ASPOSE_PDF_SHARED_API bool get_IsAccessible () const
 Gets indicating whether the font is present (installed) in the system. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< IFontOptionsget_FontOptions ()
 Useful properties to tune Font behaviour More...
 
ASPOSE_PDF_SHARED_API System::String GetLastFontEmbeddingError ()
 An objective of this method - to return description of error if an attempt to embed font was failed. If there are no error cases it returns empty string. More...
 
ASPOSE_PDF_SHARED_API void Save (System::SharedPtr< System::IO::Stream > stream)
 Saves the font into the stream. Note that the font is saved to intermediate TTF format intended to be used in a converted copy of the original document only. The font file is not intended to be used outside the original document context. More...
 
ASPOSE_PDF_SHARED_API double MeasureString (System::String str, float fontSize)
 Measures the string. More...
 
ASPOSE_PDF_SHARED_API bool CppIsSetTrailerable ()
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API 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 reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Protected Member Functions

const System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > & get_iPdfFont () const
 
void set_iPdfFont (System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > value)
 
const System::SharedPtr< Aspose::Font::IFont > & get_iFont () const
 
void set_iFont (System::SharedPtr< Aspose::Font::IFont > value)
 
System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > get_IPdfFont ()
 Pdf font object. More...
 
System::SharedPtr< Aspose::Font::IFont > get_IFont ()
 System font object. More...
 
System::String get_UniqueId ()
 
 Font (System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfPrimitive > fontObj)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Font, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfPrimitive > fontObj))
 
 Font (System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Font, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont))
 
 Font (System::SharedPtr< Aspose::Font::IFont > font)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Font, CODEPORTING_ARGS(System::SharedPtr< Aspose::Font::IFont > font))
 
 Font (System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable > trailerable, System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (Font, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable > trailerable, System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont))
 
void InitWithIPdfFont (System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable > trailerable, System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont)
 
System::SharedPtr< FontClone ()
 
virtual ASPOSE_PDF_SHARED_API ~Font ()
 

Protected Attributes

System::EventHandler FontPropertiesChanged
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. 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 ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

Represents font object.

See also
TextFragmentAbsorber
See also
FontRepository
See also
Document

Constructor & Destructor Documentation

◆ Font() [1/4]

Aspose::Pdf::Text::Font::Font ( System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfPrimitive >  fontObj)
protected

◆ Font() [2/4]

Aspose::Pdf::Text::Font::Font ( System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont >  iPdfFont)
protected

◆ Font() [3/4]

Aspose::Pdf::Text::Font::Font ( System::SharedPtr< Aspose::Font::IFont >  font)
protected

◆ Font() [4/4]

Aspose::Pdf::Text::Font::Font ( System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable >  trailerable,
System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont >  iPdfFont 
)
protected

◆ ~Font()

virtual ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::Font::~Font ( )
protectedvirtual

Member Function Documentation

◆ Clone()

System::SharedPtr<Font> Aspose::Pdf::Text::Font::Clone ( )
protected

◆ CppIsSetTrailerable()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Text::Font::CppIsSetTrailerable ( )

◆ get_BaseFont()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Text::Font::get_BaseFont ( )

Gets BaseFont value of PDF font object. Also known as PostScript name of the font.

◆ get_DecodedFontName()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Text::Font::get_DecodedFontName ( )

Sometimes PDF fonts(usually Chinese/Japanese/Korean fonts) could have specificical font name. This name is value of PDF font property "BaseFont" and sometimes this property could be represented in hexademical form. If read this name directly it could be represented in non-readable form. To get readable form it's necessary to decode font's name by rules specifical for this font. This property returns decoded font name, so use it for cases when you meet with a non-readable FontName. If property FontName has readable form this property will be the same as FontName, so you can use this property for any cases when you need to get font name in a readable form.

◆ get_FontName()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Text::Font::get_FontName ( ) const

Gets font name of the Font object.

See also
TextFragmentAbsorber
See also
Document

◆ get_FontOptions()

ASPOSE_PDF_SHARED_API System::SharedPtr<IFontOptions> Aspose::Pdf::Text::Font::get_FontOptions ( )

Useful properties to tune Font behaviour

◆ get_iFont()

const System::SharedPtr<Aspose::Font::IFont>& Aspose::Pdf::Text::Font::get_iFont ( ) const
protected

◆ get_IFont()

System::SharedPtr<Aspose::Font::IFont> Aspose::Pdf::Text::Font::get_IFont ( )
protected

System font object.

For internal usage only

◆ get_iPdfFont()

const System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont>& Aspose::Pdf::Text::Font::get_iPdfFont ( ) const
protected

◆ get_IPdfFont()

System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont> Aspose::Pdf::Text::Font::get_IPdfFont ( )
protected

Pdf font object.

For internal usage only

◆ get_IsAccessible()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Text::Font::get_IsAccessible ( ) const

Gets indicating whether the font is present (installed) in the system.

Some operations are not available with fonts that could not be found in the system.

See also
TextFragmentAbsorber
See also
Document

◆ get_IsEmbedded()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Text::Font::get_IsEmbedded ( ) const

Gets a value that indicates whether the font is embedded. Font based on IFont will automatically be subset and embedded

See also
TextFragmentAbsorber
See also
FontRepository
See also
Document

◆ get_IsSubset()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Text::Font::get_IsSubset ( )

Gets a value that indicates whether the font is a subset. Font based on IFont will automatically be subset and embedded

See also
TextFragmentAbsorber
See also
Document

◆ get_UniqueId()

System::String Aspose::Pdf::Text::Font::get_UniqueId ( )
protected

◆ GetLastFontEmbeddingError()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Text::Font::GetLastFontEmbeddingError ( )

An objective of this method - to return description of error if an attempt to embed font was failed. If there are no error cases it returns empty string.

Returns
Error description

◆ InitWithIPdfFont()

void Aspose::Pdf::Text::Font::InitWithIPdfFont ( System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable >  trailerable,
System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont >  iPdfFont 
)
protected

◆ MeasureString()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Text::Font::MeasureString ( System::String  str,
float  fontSize 
)

Measures the string.

Parameters
strThe string.
fontSizeFont size.
Returns
Width of the string represented with this font and the specified size.

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [1/4]

Aspose::Pdf::Text::Font::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( Font  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfPrimitive > fontObj)   
)
protected

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [2/4]

Aspose::Pdf::Text::Font::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( Font  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont)   
)
protected

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [3/4]

Aspose::Pdf::Text::Font::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( Font  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Font::IFont > font)   
)
protected

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [4/4]

Aspose::Pdf::Text::Font::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( Font  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::ITrailerable > trailerable, System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont > iPdfFont)   
)
protected

◆ Save()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::Font::Save ( System::SharedPtr< System::IO::Stream stream)

Saves the font into the stream. Note that the font is saved to intermediate TTF format intended to be used in a converted copy of the original document only. The font file is not intended to be used outside the original document context.

Parameters
streamStream to save the font.

◆ set_iFont()

void Aspose::Pdf::Text::Font::set_iFont ( System::SharedPtr< Aspose::Font::IFont >  value)
protected

◆ set_iPdfFont()

void Aspose::Pdf::Text::Font::set_iPdfFont ( System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Fonts::IPdfFont >  value)
protected

◆ set_IsEmbedded()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::Font::set_IsEmbedded ( bool  value)

Sets a value that indicates whether the font is embedded. Font based on IFont will automatically be subset and embedded

See also
TextFragmentAbsorber
See also
FontRepository
See also
Document

◆ set_IsSubset()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::Font::set_IsSubset ( bool  value)

Sets a value that indicates whether the font is a subset. Font based on IFont will automatically be subset and embedded

See also
TextFragmentAbsorber
See also
Document

Member Data Documentation

◆ FontPropertiesChanged

System::EventHandler Aspose::Pdf::Text::Font::FontPropertiesChanged
protected