Use this class instead of GDI+ Font More...

Inherits System::Object.

Public Member Functions

ASPOSE_PAGE_SHARED_API System::Drawing::FontStyle get_Style ()
 Gets the true type font. More...
 
ASPOSE_PAGE_SHARED_API bool get_IsBold ()
 Gets a value indicating whether this instance is bold. More...
 
ASPOSE_PAGE_SHARED_API bool get_IsItalic ()
 Gets a value indicating whether this instance is italic. More...
 
ASPOSE_PAGE_SHARED_API float get_SmallCapsScaleFactor ()
 Gets the font capitals. More...
 
ASPOSE_PAGE_SHARED_API System::String get_FamilyName ()
 Gets name of this font. More...
 
ASPOSE_PAGE_SHARED_API float get_SizePoints ()
 Gets size of this font (points). More...
 
ASPOSE_PAGE_SHARED_API void set_SizePoints (float value)
 Gets size of this font (points). More...
 
ASPOSE_PAGE_SHARED_API float get_AscentPoints ()
 Returns the cell ascent in points. More...
 
ASPOSE_PAGE_SHARED_API float get_DescentPoints ()
 Returns the cell descent in points. More...
 
ASPOSE_PAGE_SHARED_API float get_CellHeightPoints ()
 Shortcut for AscentPoints + DescentPoints. More...
 
ASPOSE_PAGE_SHARED_API int32_t get_AscentLis ()
 Cell ascent of this font (lis). This is a vertical distance from cell top to cell baseline. More...
 
ASPOSE_PAGE_SHARED_API int32_t get_DescentLis ()
 Cell descent of this font (lis). This is a vertical distance from cell bottom to cell baseline. More...
 
ASPOSE_PAGE_SHARED_API int32_t get_CellHeightLis ()
 Returns cell height of this font (lis). This is a shortcut for AscentLis + DescentLis. More...
 
ASPOSE_PAGE_SHARED_API int32_t get_LeadingLis ()
 Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis. More...
 
ASPOSE_PAGE_SHARED_API float get_LeadingPoints ()
 Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis. More...
 
ASPOSE_PAGE_SHARED_API int32_t get_LineSpacingLis ()
 Returns cell spacing of this font (lis). This is a vertical distance between baselines of the two glyphs. More...
 
ASPOSE_PAGE_SHARED_API float get_LineSpacingPoints ()
 Returns cell spacing of this font (points). This is a vertical distance between baselines of the two glyphs. More...
 
ASPOSE_PAGE_SHARED_API int16_t get_StyleEx ()
 This property contains additional information about font's style More...
 
ASPOSE_PAGE_SHARED_API void set_StyleEx (int16_t value)
 This property contains additional information about font's style More...
 
ASPOSE_PAGE_SHARED_API void Replace (System::SharedPtr< DrFont > font)
 Replace font content More...
 
ASPOSE_PAGE_SHARED_API float GetCharWidthPoints (char16_t c)
 Returns width of the character (points). More...
 
ASPOSE_PAGE_SHARED_API float GetTextWidthPoints (System::String text)
 Gets the text width points. More...
 
ASPOSE_PAGE_SHARED_API float GetTextWidthPoints (System::String text, int32_t startIndex, int32_t charCount)
 Gets the text width points. More...
 
ASPOSE_PAGE_SHARED_API System::Drawing::SizeF GetTextSizePoints (System::String text)
 Returns measurement text box of the text in points. More...
 
ASPOSE_PAGE_SHARED_API int32_t GetCharWidthLis (char16_t c)
 Gets the char width lis. More...
 
ASPOSE_PAGE_SHARED_API int32_t GetTextWidthLis (System::String text)
 Gets the text width lis. More...
 
ASPOSE_PAGE_SHARED_API bool Equals (System::SharedPtr< System::Object > obj) override
 Determines whether the specified System::Object, is equal to this instance. More...
 
ASPOSE_PAGE_SHARED_API int32_t GetHashCode () const override
 Returns a hash code for this instance. More...
 
- 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 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)
 
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)
 

Static Public Member Functions

static ASPOSE_PAGE_SHARED_API bool IsPoorlyRenderedByGdiPlus (System::String fontName)
 Returns True for "Microsoft Sans Serif" font. This one is poorly rendered by GDI+. See Test286 and Gemini-6959. 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...
 

Protected Member Functions

System::SharedPtr< Foundation::Drawing::DrFont > get_Font () const
 
 DrFont (System::SharedPtr< Aspose::Foundation::Drawing::DrFont > font)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (DrFont, CODEPORTING_ARGS(System::SharedPtr< Aspose::Foundation::Drawing::DrFont > font))
 
ASPOSE_PAGE_SHARED_API bool Equals (System::SharedPtr< DrFont > other)
 Equalses the specified other. More...
 
virtual ASPOSE_PAGE_SHARED_API ~DrFont ()
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

Use this class instead of GDI+ Font

Constructor & Destructor Documentation

◆ DrFont()

Aspose::Page::Font::DrFont::DrFont ( System::SharedPtr< Aspose::Foundation::Drawing::DrFont >  font)
protected

◆ ~DrFont()

virtual ASPOSE_PAGE_SHARED_API Aspose::Page::Font::DrFont::~DrFont ( )
protectedvirtual

Member Function Documentation

◆ Equals() [1/2]

ASPOSE_PAGE_SHARED_API bool Aspose::Page::Font::DrFont::Equals ( System::SharedPtr< System::Object obj)
override

Determines whether the specified System::Object, is equal to this instance.

Parameters
objThe System::Object to compare with this instance.
Returns
true if the specified System::Object is equal to this instance; otherwise, false.

◆ Equals() [2/2]

ASPOSE_PAGE_SHARED_API bool Aspose::Page::Font::DrFont::Equals ( System::SharedPtr< DrFont other)
protected

Equalses the specified other.

Parameters
otherThe other object.
Returns
true if the specified DrFont is equal to this instance; otherwise, false.

◆ get_AscentLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::get_AscentLis ( )

Cell ascent of this font (lis). This is a vertical distance from cell top to cell baseline.

This value is also called cell baseline.

◆ get_AscentPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_AscentPoints ( )

Returns the cell ascent in points.

◆ get_CellHeightLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::get_CellHeightLis ( )

Returns cell height of this font (lis). This is a shortcut for AscentLis + DescentLis.

◆ get_CellHeightPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_CellHeightPoints ( )

Shortcut for AscentPoints + DescentPoints.

◆ get_DescentLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::get_DescentLis ( )

Cell descent of this font (lis). This is a vertical distance from cell bottom to cell baseline.

◆ get_DescentPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_DescentPoints ( )

Returns the cell descent in points.

◆ get_FamilyName()

ASPOSE_PAGE_SHARED_API System::String Aspose::Page::Font::DrFont::get_FamilyName ( )

Gets name of this font.

The name of the family.

◆ get_Font()

System::SharedPtr<Foundation::Drawing::DrFont> Aspose::Page::Font::DrFont::get_Font ( ) const
protected

◆ get_IsBold()

ASPOSE_PAGE_SHARED_API bool Aspose::Page::Font::DrFont::get_IsBold ( )

Gets a value indicating whether this instance is bold.

true if this instance is bold; otherwise, false.

◆ get_IsItalic()

ASPOSE_PAGE_SHARED_API bool Aspose::Page::Font::DrFont::get_IsItalic ( )

Gets a value indicating whether this instance is italic.

true if this instance is italic; otherwise, false.

◆ get_LeadingLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::get_LeadingLis ( )

Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis.

◆ get_LeadingPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_LeadingPoints ( )

Returns leading of this font (lis). This is a shortcut for LineSpacingLis - CellHeightLis.

◆ get_LineSpacingLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::get_LineSpacingLis ( )

Returns cell spacing of this font (lis). This is a vertical distance between baselines of the two glyphs.

◆ get_LineSpacingPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_LineSpacingPoints ( )

Returns cell spacing of this font (points). This is a vertical distance between baselines of the two glyphs.

◆ get_SizePoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_SizePoints ( )

Gets size of this font (points).

The size points.

◆ get_SmallCapsScaleFactor()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::get_SmallCapsScaleFactor ( )

Gets the font capitals.

Gets the SmallCaps scale factor.

◆ get_Style()

ASPOSE_PAGE_SHARED_API System::Drawing::FontStyle Aspose::Page::Font::DrFont::get_Style ( )

Gets the true type font.

Gets style of this font.

◆ get_StyleEx()

ASPOSE_PAGE_SHARED_API int16_t Aspose::Page::Font::DrFont::get_StyleEx ( )

This property contains additional information about font's style

◆ GetCharWidthLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::GetCharWidthLis ( char16_t  c)

Gets the char width lis.

Parameters
cThe symbol to calculate.
Returns
Returns width

◆ GetCharWidthPoints()

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::GetCharWidthPoints ( char16_t  c)

Returns width of the character (points).

Parameters
cThe symbol to calculate.
Returns
Returns width

◆ GetHashCode()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::GetHashCode ( ) const
overridevirtual

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Reimplemented from System::Object.

◆ GetTextSizePoints()

ASPOSE_PAGE_SHARED_API System::Drawing::SizeF Aspose::Page::Font::DrFont::GetTextSizePoints ( System::String  text)

Returns measurement text box of the text in points.

Parameters
textThe text to calculate.
Returns
Returns size

◆ GetTextWidthLis()

ASPOSE_PAGE_SHARED_API int32_t Aspose::Page::Font::DrFont::GetTextWidthLis ( System::String  text)

Gets the text width lis.

Parameters
textThe text to calculate.
Returns
Returns width

◆ GetTextWidthPoints() [1/2]

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::GetTextWidthPoints ( System::String  text)

Gets the text width points.

Parameters
textThe text to calculate.
Returns
Returns width

◆ GetTextWidthPoints() [2/2]

ASPOSE_PAGE_SHARED_API float Aspose::Page::Font::DrFont::GetTextWidthPoints ( System::String  text,
int32_t  startIndex,
int32_t  charCount 
)

Gets the text width points.

Parameters
textThe text to calculate.
startIndexThe start index.
charCountThe char count.
Returns
Returns width

◆ IsPoorlyRenderedByGdiPlus()

static ASPOSE_PAGE_SHARED_API bool Aspose::Page::Font::DrFont::IsPoorlyRenderedByGdiPlus ( System::String  fontName)
static

Returns True for "Microsoft Sans Serif" font. This one is poorly rendered by GDI+. See Test286 and Gemini-6959.

Parameters
fontNameName of the font.
Returns
true if [is poorly rendered by GDI plus] [the specified font name]; otherwise, false.

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION()

Aspose::Page::Font::DrFont::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( DrFont  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Foundation::Drawing::DrFont > font)   
)
protected

◆ Replace()

ASPOSE_PAGE_SHARED_API void Aspose::Page::Font::DrFont::Replace ( System::SharedPtr< DrFont font)

Replace font content

Parameters
fontThe source font.

◆ set_SizePoints()

ASPOSE_PAGE_SHARED_API void Aspose::Page::Font::DrFont::set_SizePoints ( float  value)

Gets size of this font (points).

The size points.

◆ set_StyleEx()

ASPOSE_PAGE_SHARED_API void Aspose::Page::Font::DrFont::set_StyleEx ( int16_t  value)

This property contains additional information about font's style