Aspose::Font::Ttf::TtfFontMetrics Class Reference

Represents TTF Font metrics. More...

Inherits Aspose::Font::FontMetrics.

Public Member Functions

ASPOSE_FONT_SHARED_API double get_Ascender () override
 Gets ascender value. More...
 
ASPOSE_FONT_SHARED_API void set_Ascender (double value) override
 Gets ascender value. More...
 
ASPOSE_FONT_SHARED_API double get_Descender () override
 Gets descender value. More...
 
ASPOSE_FONT_SHARED_API void set_Descender (double value) override
 Gets descender value. More...
 
ASPOSE_FONT_SHARED_API double get_TypoAscender () override
 Gets TypoAscender value. More...
 
ASPOSE_FONT_SHARED_API void set_TypoAscender (double value) override
 Gets TypoAscender value. More...
 
ASPOSE_FONT_SHARED_API double get_TypoDescender () override
 Gets TypoDescender value. More...
 
ASPOSE_FONT_SHARED_API void set_TypoDescender (double value) override
 Gets TypoDescender value. More...
 
ASPOSE_FONT_SHARED_API double get_LineGap () override
 Gets LineGap value. More...
 
ASPOSE_FONT_SHARED_API double get_TypoLineGap () override
 Gets TypoLineGap value. More...
 
ASPOSE_FONT_SHARED_API System::SharedPtr< Aspose::Font::FontBBoxget_FontBBox () override
 Gets FontBBox value. More...
 
ASPOSE_FONT_SHARED_API System::SharedPtr< TransformationMatrixget_FontMatrix () override
 Gets FontBBox value. More...
 
ASPOSE_FONT_SHARED_API uint32_t get_UnitsPerEM () override
 Gets UnitsPerEM value. More...
 
ASPOSE_FONT_SHARED_API void set_UnitsPerEM (uint32_t value) override
 Gets UnitsPerEM value. More...
 
ASPOSE_FONT_SHARED_API double GetGlyphWidth (System::SharedPtr< Aspose::Font::Glyphs::GlyphId > glyphId) override
 Returns glyphs width by glyph id. More...
 
ASPOSE_FONT_SHARED_API double MeasureString (System::String unicode, double fontSize) override
 Measures string and returns string width. More...
 
ASPOSE_FONT_SHARED_API double GetKerningValue (System::SharedPtr< Aspose::Font::Glyphs::GlyphId > prevGlyphId, System::SharedPtr< Aspose::Font::Glyphs::GlyphId > nextGlyphId) override
 Returns kerning value for the glyph pair. More...
 
- Public Member Functions inherited from Aspose::Font::FontMetrics
ASPOSE_FONT_SHARED_API bool get_IsFixedPitch () override
 Gets IsFixedPitch value. More...
 
ASPOSE_FONT_SHARED_API double GetAscender (double fontSize) override
 Returns ascender for specific Font size. More...
 
ASPOSE_FONT_SHARED_API double GetDescender (double fontSize) override
 Returns descender for specific Font size. More...
 
ASPOSE_FONT_SHARED_API double GetTypoDescender (double fontSize) override
 Returns descender for specific Font size. More...
 
ASPOSE_FONT_SHARED_API double GetTypoAscender (double fontSize) override
 Returns descender for specific Font size. More...
 
ASPOSE_FONT_SHARED_API double GetTypoLineGap (double fontSize) override
 Returns line gap for specific Font size. More...
 
ASPOSE_FONT_SHARED_API double GetGlyphWidth (System::SharedPtr< Glyphs::GlyphId > glyphId) override
 Returns glyph width. May be overridden by specific font encoding inheritors. More...
 
ASPOSE_FONT_SHARED_API System::SharedPtr< Aspose::Font::FontBBoxGetGlyphBBox (System::SharedPtr< Glyphs::GlyphId > glyphId) override
 Returns glyph BBox. Returns FontBBox if BBox was not defined for the glyph. May be overridden by specific font encoding inheritors. More...
 
ASPOSE_FONT_SHARED_API double GetKerningValue (System::SharedPtr< Glyphs::GlyphId > prevGlyphId, System::SharedPtr< Glyphs::GlyphId > nextGlyphId) override
 Returns kerning value for the glyph pair. 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 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

 TtfFontMetrics (System::SharedPtr< TtfFont > owner)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (TtfFontMetrics, CODEPORTING_ARGS(System::SharedPtr< TtfFont > owner))
 
double GetCharWidth (char16_t ch)
 
ASPOSE_FONT_SHARED_API int32_t GetGlyphIdHashCode (System::SharedPtr< Aspose::Font::Glyphs::GlyphId > glyphId) override
 
- Protected Member Functions inherited from Aspose::Font::FontMetrics
ASPOSE_FONT_SHARED_API void set_IsFixedPitch (bool value)
 Gets IsFixedPitch value. More...
 
virtual ASPOSE_FONT_SHARED_API void set_FontBBox (System::SharedPtr< Aspose::Font::FontBBox > value)
 Gets FontBBox value. More...
 
virtual ASPOSE_FONT_SHARED_API void set_FontMatrix (System::SharedPtr< TransformationMatrix > value)
 Gets FontMatrix value. More...
 
 FontMetrics ()
 
virtual int32_t GetGlyphIdHashCode (System::SharedPtr< Glyphs::GlyphId > glyphId)=0
 returns hashcode, based on glyph id type More...
 
virtual ASPOSE_FONT_SHARED_API void AddGlyphMetrics (System::SharedPtr< Glyphs::GlyphId > glyphId, double width, System::SharedPtr< Aspose::Font::FontBBox > bbox)
 
virtual ASPOSE_FONT_SHARED_API void AddTrackKerning ()
 
virtual ASPOSE_FONT_SHARED_API void AddKerningPair (System::SharedPtr< Glyphs::GlyphId > previousGlyphId, System::SharedPtr< Glyphs::GlyphId > nextGlyphId, double kerningValue)
 

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...
 
- Protected Attributes inherited from Aspose::Font::FontMetrics
System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, System::SharedPtr< Type1::Internals::Metrics::GlyphMetrics > > > GlyphMetricsMap
 
System::SharedPtr< Type1::Internals::Metrics::KerningDataMap > GlyphKerningMap
 

Detailed Description

Represents TTF Font metrics.

Constructor & Destructor Documentation

◆ TtfFontMetrics()

Aspose::Font::Ttf::TtfFontMetrics::TtfFontMetrics ( System::SharedPtr< TtfFont owner)
protected

Member Function Documentation

◆ get_Ascender()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_Ascender ( )
overridevirtual

Gets ascender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_Descender()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_Descender ( )
overridevirtual

Gets descender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_FontBBox()

ASPOSE_FONT_SHARED_API System::SharedPtr<Aspose::Font::FontBBox> Aspose::Font::Ttf::TtfFontMetrics::get_FontBBox ( )
overridevirtual

Gets FontBBox value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_FontMatrix()

ASPOSE_FONT_SHARED_API System::SharedPtr<TransformationMatrix> Aspose::Font::Ttf::TtfFontMetrics::get_FontMatrix ( )
overridevirtual

Gets FontBBox value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_LineGap()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_LineGap ( )
overridevirtual

Gets LineGap value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_TypoAscender()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_TypoAscender ( )
overridevirtual

Gets TypoAscender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_TypoDescender()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_TypoDescender ( )
overridevirtual

Gets TypoDescender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_TypoLineGap()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::get_TypoLineGap ( )
overridevirtual

Gets TypoLineGap value.

Reimplemented from Aspose::Font::FontMetrics.

◆ get_UnitsPerEM()

ASPOSE_FONT_SHARED_API uint32_t Aspose::Font::Ttf::TtfFontMetrics::get_UnitsPerEM ( )
overridevirtual

Gets UnitsPerEM value.

Reimplemented from Aspose::Font::FontMetrics.

◆ GetCharWidth()

double Aspose::Font::Ttf::TtfFontMetrics::GetCharWidth ( char16_t  ch)
protected
Deprecated:
please use TtfFont.Encoding.DecodeToGlyphId(char unicode) => GetGlyphWidth(glyphId) instead

◆ GetGlyphIdHashCode()

ASPOSE_FONT_SHARED_API int32_t Aspose::Font::Ttf::TtfFontMetrics::GetGlyphIdHashCode ( System::SharedPtr< Aspose::Font::Glyphs::GlyphId glyphId)
overrideprotected

◆ GetGlyphWidth()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::GetGlyphWidth ( System::SharedPtr< Aspose::Font::Glyphs::GlyphId glyphId)
override

Returns glyphs width by glyph id.

Parameters
glyphIdGlyph identifier.
Returns
Glyph width.

◆ GetKerningValue()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::GetKerningValue ( System::SharedPtr< Aspose::Font::Glyphs::GlyphId prevGlyphId,
System::SharedPtr< Aspose::Font::Glyphs::GlyphId nextGlyphId 
)
override

Returns kerning value for the glyph pair.

Parameters
prevGlyphIdFirst glyph in pair.
nextGlyphIdFont size.
Returns
Kerning value.

◆ MeasureString()

ASPOSE_FONT_SHARED_API double Aspose::Font::Ttf::TtfFontMetrics::MeasureString ( System::String  unicode,
double  fontSize 
)
overridevirtual

Measures string and returns string width.

Parameters
unicodeUnicode string.
fontSizeFont size.
Returns
String width.

Implements Aspose::Font::FontMetrics.

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION()

Aspose::Font::Ttf::TtfFontMetrics::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( TtfFontMetrics  ,
CODEPORTING_ARGS(System::SharedPtr< TtfFont > owner)   
)
protected

◆ set_Ascender()

ASPOSE_FONT_SHARED_API void Aspose::Font::Ttf::TtfFontMetrics::set_Ascender ( double  value)
overridevirtual

Gets ascender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ set_Descender()

ASPOSE_FONT_SHARED_API void Aspose::Font::Ttf::TtfFontMetrics::set_Descender ( double  value)
overridevirtual

Gets descender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ set_TypoAscender()

ASPOSE_FONT_SHARED_API void Aspose::Font::Ttf::TtfFontMetrics::set_TypoAscender ( double  value)
overridevirtual

Gets TypoAscender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ set_TypoDescender()

ASPOSE_FONT_SHARED_API void Aspose::Font::Ttf::TtfFontMetrics::set_TypoDescender ( double  value)
overridevirtual

Gets TypoDescender value.

Reimplemented from Aspose::Font::FontMetrics.

◆ set_UnitsPerEM()

ASPOSE_FONT_SHARED_API void Aspose::Font::Ttf::TtfFontMetrics::set_UnitsPerEM ( uint32_t  value)
overridevirtual

Gets UnitsPerEM value.

Reimplemented from Aspose::Font::FontMetrics.