Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Friends | List of all members
hdi::core::Font Class Reference

Font class to allow for easy font manipulation. More...

#include <hdicoreFont.h>

Classes

class  Info
 Describes style information for an individual font. More...
 

Public Types

typedef std::unique_ptr< InfoInfoUP
 
typedef std::shared_ptr< InfoInfoSP
 
typedef std::weak_ptr< InfoInfoWP
 

Public Member Functions

 Font ()
 Creates a Font object with the default native script (e.g. roman, cyrillic, etc.)
 
 Font (const Font &f_)
 Font copy constructor.
 
 Font (const AIFontKey aiFont_)
 Constructs a new Font object from an AIFontKey.
 
virtual ~Font ()
 Destructs a Font object.
 
virtual Fontoperator= (const Font &rhs_)
 Overloaded assignment operator for Font objects.
 
virtual bool operator== (const Font &rhs_) const
 Tests whether a given Font object is the same as another.
 
virtual bool operator!= (const Font &rhs_) const
 Tests whether a given Font object is not the same as another.
 
virtual AIFontKey aiFontKey () const
 Gets the font key around which the target object is wrapped.
 
virtual Info info () const
 Gets the font's style info.
 
virtual bool typefaceAndStyle (Typeface &tf__, int32_t &style__)
 Gets the typeface (family) and style variant of the target font.
 
virtual bool substituted () const
 Gets whether the target font is substituted or not.
 
virtual std::string name () const
 Gets the name of the font.
 
virtual std::string familyName () const
 Gets the name of the family for the target font.
 
virtual std::string styleName () const
 Gets the name of the style for the target font.
 
virtual std::string postScriptName () const
 Gets the PostScript name of the font.
 
virtual PlatformFontPtr platformFont (const double size_) const
 Gets the platform font for the target Adobe app font, if available.
 

Friends

aip::Font * __accessImpl (const Font &)
 
Font __accessCtor (const aip::Font &)
 

Detailed Description

Font class to allow for easy font manipulation.

Constructor & Destructor Documentation

◆ Font() [1/3]

hdi::core::Font::Font ( )

Creates a Font object with the default native script (e.g. roman, cyrillic, etc.)

Author
GW
Date
08/2013
Returns
A unique Font object for the default script

◆ Font() [2/3]

hdi::core::Font::Font ( const Font f_)

Font copy constructor.

Author
GW
Date
08/2013
Parameters
f_Font object to copy values from

◆ Font() [3/3]

hdi::core::Font::Font ( const AIFontKey  aiFont_)

Constructs a new Font object from an AIFontKey.

Author
GW
Date
08/2015
Parameters
aiFont_Raw Illustrator AIFontKey

◆ ~Font()

virtual hdi::core::Font::~Font ( )
virtual

Destructs a Font object.

Author
GW
Date
08/2013

Member Function Documentation

◆ aiFontKey()

virtual AIFontKey hdi::core::Font::aiFontKey ( ) const
virtual

Gets the font key around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIFontKey for this object
Note
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of functionality provided by Illustrator is not handled by this class (or related classes), then it should probably be added to the hdi_core library.

◆ familyName()

virtual std::string hdi::core::Font::familyName ( ) const
virtual

Gets the name of the family for the target font.

Author
GW
Date
08/2014
Returns
The family name of the font, as UTF-8

◆ info()

virtual Info hdi::core::Font::info ( ) const
virtual

Gets the font's style info.

Author
GW
Date
08/2013
Returns
An Info object describing the font's style info

◆ name()

virtual std::string hdi::core::Font::name ( ) const
virtual

Gets the name of the font.

Author
GW
Date
08/2013
Returns
The name of the font, as UTF-8

◆ operator!=()

virtual bool hdi::core::Font::operator!= ( const Font rhs_) const
virtual

Tests whether a given Font object is not the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Font to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different fonts, false otherwise

◆ operator=()

virtual Font & hdi::core::Font::operator= ( const Font rhs_)
virtual

Overloaded assignment operator for Font objects.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the assignment operator; existing Font object to copy values from
Returns
The lefthand side of the assignment operator, but with its values updated

◆ operator==()

virtual bool hdi::core::Font::operator== ( const Font rhs_) const
virtual

Tests whether a given Font object is the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Font to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same font, false otherwise

◆ platformFont()

virtual PlatformFontPtr hdi::core::Font::platformFont ( const double  size_) const
virtual

Gets the platform font for the target Adobe app font, if available.

Author
GW
Date
06/2018
Parameters
size_Desired font size
Returns
A pointer to the platform/OS font, or NULL if none/unavailable
Warning
On Windows, it is the caller's responsibility to cleanup the returned font pointer when no longer needed by passing it to the DeleteObject() function.

◆ postScriptName()

virtual std::string hdi::core::Font::postScriptName ( ) const
virtual

Gets the PostScript name of the font.

Author
GW
Date
12/2017
Returns
The name of the font

◆ styleName()

virtual std::string hdi::core::Font::styleName ( ) const
virtual

Gets the name of the style for the target font.

Author
GW
Date
08/2014
Returns
The style name of the font, as UTF-8

◆ substituted()

virtual bool hdi::core::Font::substituted ( ) const
virtual

Gets whether the target font is substituted or not.

Author
GW
Date
08/2014
Returns
true if substituted, false otherwise

◆ typefaceAndStyle()

virtual bool hdi::core::Font::typefaceAndStyle ( Typeface tf__,
int32_t &  style__ 
)
virtual

Gets the typeface (family) and style variant of the target font.

Author
GW
Date
08/2014
Parameters
tf__Return-by-reference for the typeface
style__Return-by-reference for the index position of the style variant
Returns
true if the typeface and style index could be acquired, false otherwise