Aspose::Font::FontMetrics Class Referenceabstract

Represents Font metrics. More...

Inherits Aspose::Font::IFontMetrics.

Inherited by Aspose::Font::Cff::CffFontMetrics, Aspose::Font::Ttf::TtfFontMetrics, and Aspose::Font::Type1::Type1FontMetrics.

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_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_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_LineGap () override
 Gets LineGap value. More...
 
ASPOSE_FONT_SHARED_API double get_TypoLineGap () override
 Gets TypoLineGap value. More...
 
ASPOSE_FONT_SHARED_API bool get_IsFixedPitch () override
 Gets IsFixedPitch 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 FontMatrix 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 GetKerningValue (System::SharedPtr< Glyphs::GlyphId > prevGlyphId, System::SharedPtr< Glyphs::GlyphId > nextGlyphId) override
 Returns kerning value for the glyph pair. 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 MeasureString (System::String unicode, double fontSize) override=0
 Measures string and returns string width. 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

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)
 

Protected Attributes

System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, System::SharedPtr< Type1::Internals::Metrics::GlyphMetrics > > > glyphMetricsMap
 
System::SharedPtr< Type1::Internals::Metrics::KerningDataMap > glyphKerningMap
 

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

Constructor & Destructor Documentation

◆ FontMetrics()

Aspose::Font::FontMetrics::FontMetrics ( )
protected

Member Function Documentation

◆ AddGlyphMetrics()

virtual ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::AddGlyphMetrics ( System::SharedPtr< Glyphs::GlyphId glyphId,
double  width,
System::SharedPtr< Aspose::Font::FontBBox bbox 
)
protectedvirtual

◆ AddKerningPair()

virtual ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::AddKerningPair ( System::SharedPtr< Glyphs::GlyphId previousGlyphId,
System::SharedPtr< Glyphs::GlyphId nextGlyphId,
double  kerningValue 
)
protectedvirtual

◆ AddTrackKerning()

virtual ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::AddTrackKerning ( )
protectedvirtual

◆ get_Ascender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_Ascender ( )
overridevirtual

◆ get_Descender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_Descender ( )
overridevirtual

◆ get_FontBBox()

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

◆ get_FontMatrix()

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

◆ get_IsFixedPitch()

ASPOSE_FONT_SHARED_API bool Aspose::Font::FontMetrics::get_IsFixedPitch ( )
overridevirtual

Gets IsFixedPitch value.

Implements Aspose::Font::IFontMetrics.

◆ get_LineGap()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_LineGap ( )
overridevirtual

Gets LineGap value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ get_TypoAscender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_TypoAscender ( )
overridevirtual

Gets TypoAscender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ get_TypoDescender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_TypoDescender ( )
overridevirtual

Gets TypoDescender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ get_TypoLineGap()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::get_TypoLineGap ( )
overridevirtual

Gets TypoLineGap value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ get_UnitsPerEM()

ASPOSE_FONT_SHARED_API uint32_t Aspose::Font::FontMetrics::get_UnitsPerEM ( )
overridevirtual

◆ GetAscender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetAscender ( double  fontSize)
overridevirtual

Returns ascender for specific Font size.

Parameters
fontSizeFont size.
Returns
Ascender value.

Implements Aspose::Font::IFontMetrics.

◆ GetDescender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetDescender ( double  fontSize)
overridevirtual

Returns descender for specific Font size.

Parameters
fontSizeFont size.
Returns
Descender value.

Implements Aspose::Font::IFontMetrics.

◆ GetGlyphBBox()

ASPOSE_FONT_SHARED_API System::SharedPtr<Aspose::Font::FontBBox> Aspose::Font::FontMetrics::GetGlyphBBox ( System::SharedPtr< Glyphs::GlyphId glyphId)
overridevirtual

Returns glyph BBox. Returns FontBBox if BBox was not defined for the glyph. May be overridden by specific font encoding inheritors.

Parameters
glyphIdGlyph identifier.
Returns
Glyph BBox.

Implements Aspose::Font::IFontMetrics.

◆ GetGlyphIdHashCode()

virtual int32_t Aspose::Font::FontMetrics::GetGlyphIdHashCode ( System::SharedPtr< Glyphs::GlyphId glyphId)
protectedpure virtual

returns hashcode, based on glyph id type

Parameters
glyphIdglyph identifier
Returns
hashcode

◆ GetGlyphWidth()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetGlyphWidth ( System::SharedPtr< Glyphs::GlyphId glyphId)
overridevirtual

Returns glyph width. May be overridden by specific font encoding inheritors.

Parameters
glyphIdGlyph identifier.
Returns
Glyph width.

Implements Aspose::Font::IFontMetrics.

◆ GetKerningValue()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetKerningValue ( System::SharedPtr< Glyphs::GlyphId prevGlyphId,
System::SharedPtr< Glyphs::GlyphId nextGlyphId 
)
overridevirtual

Returns kerning value for the glyph pair.

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

Implements Aspose::Font::IFontMetrics.

◆ GetTypoAscender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetTypoAscender ( double  fontSize)
overridevirtual

Returns descender for specific Font size.

Parameters
fontSizeFont size.
Returns
Typographic ascender value.

Implements Aspose::Font::IFontMetrics.

◆ GetTypoDescender()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetTypoDescender ( double  fontSize)
overridevirtual

Returns descender for specific Font size.

Parameters
fontSizeFont size.
Returns
Typographic descender value.

Implements Aspose::Font::IFontMetrics.

◆ GetTypoLineGap()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::GetTypoLineGap ( double  fontSize)
overridevirtual

Returns line gap for specific Font size.

Parameters
fontSizeFont size.
Returns
Line gap value.

Implements Aspose::Font::IFontMetrics.

◆ MeasureString()

ASPOSE_FONT_SHARED_API double Aspose::Font::FontMetrics::MeasureString ( System::String  unicode,
double  fontSize 
)
overridepure virtual

Measures string and returns string width.

Parameters
unicodeUnicode string.
fontSizeFont size.
Returns
String width.

Implements Aspose::Font::IFontMetrics.

Implemented in Aspose::Font::Ttf::TtfFontMetrics, Aspose::Font::Type1::Type1FontMetrics, and Aspose::Font::Cff::CffFontMetrics.

◆ set_Ascender()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_Ascender ( double  value)
overridevirtual

Gets Ascender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ set_Descender()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_Descender ( double  value)
overridevirtual

Gets Descender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ set_FontBBox()

virtual ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_FontBBox ( System::SharedPtr< Aspose::Font::FontBBox value)
protectedvirtual

Gets FontBBox value.

Reimplemented in Aspose::Font::Type1::Type1FontMetrics.

◆ set_FontMatrix()

virtual ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_FontMatrix ( System::SharedPtr< TransformationMatrix value)
protectedvirtual

Gets FontMatrix value.

Reimplemented in Aspose::Font::Type1::Type1FontMetrics.

◆ set_IsFixedPitch()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_IsFixedPitch ( bool  value)
protected

Gets IsFixedPitch value.

◆ set_TypoAscender()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_TypoAscender ( double  value)
overridevirtual

Gets TypoAscender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ set_TypoDescender()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_TypoDescender ( double  value)
overridevirtual

Gets TypoDescender value.

Implements Aspose::Font::IFontMetrics.

Reimplemented in Aspose::Font::Ttf::TtfFontMetrics.

◆ set_UnitsPerEM()

ASPOSE_FONT_SHARED_API void Aspose::Font::FontMetrics::set_UnitsPerEM ( uint32_t  value)
overridevirtual

Member Data Documentation

◆ glyphKerningMap

System::SharedPtr<Type1::Internals::Metrics::KerningDataMap> Aspose::Font::FontMetrics::glyphKerningMap
protected

◆ glyphMetricsMap

System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, System::SharedPtr<Type1::Internals::Metrics::GlyphMetrics> > > Aspose::Font::FontMetrics::glyphMetricsMap
protected