Finale PDK Framework 0.74
Public Types | Public Member Functions | Static Public Member Functions | List of all members
FCFontInfo Class Reference

Class for document-independent font information. More...

#include <ff_base.h>

Inheritance diagram for FCFontInfo:
__FCBase

Public Types

enum  ENIGMASTYLES {
  ENIGMASTYLE_PLAIN = FONT_EFX_PLAIN , ENIGMASTYLE_BOLD = FONT_EFX_BOLD , ENIGMASTYLE_ITALIC = FONT_EFX_ITALIC , ENIGMASTYLE_UNDERLINE = FONT_EFX_UNDERLINE ,
  ENIGMASTYLE_STRIKEOUT = FONT_EFX_STRIKEOUT , ENIGMASTYLE_ABSOLUTE = FONT_EFX_ABSOLUTE , ENIGMASTYLE_HIDDEN = FONT_EFX_HIDDEN
}
 Constants for enigma styles. These are bit-sensitve values that can be combined with bitwise-or. More...
 
- Public Types inherited from __FCBase
enum  PDKFRAMEWORK_CLASSID {
  FCID_UNKNOWN = 0 , FCID_ACCIDENTALMOD , FCID_ACTIVELYRIC , FCID_ALLOTMENT ,
  FCID_ARTICULATION , FCID_ARTICULATIONDEF , FCID_BACKWARDREPEAT , FCID_BASELINE ,
  FCID_BEAMMOD , FCID_BEATCHARTELEMENT , FCID_BOOKMARK , FCID_BROKENBEAMMOD ,
  FCID_CATEGORYDEF , FCID_CELLCLEFCHANGE , FCID_CELLFRAMEHOLD , FCID_CELLGRAPHIC ,
  FCID_CELLTEXT , FCID_CENTERSMARTSHAPE , FCID_CHORD , FCID_CHORDPREFS ,
  FCID_CHORDSUFFIXELEMENT , FCID_CHORUSSYLLABLE , FCID_CLEFDEF , FCID_COMPOSITETIMESIGBOTTOMELEMENT ,
  FCID_COMPOSITETIMESIGTOPELEMENT , FCID_CROSSSTAFFMOD , FCID_CUSTOMSMARTLINEDEF , FCID_CUSTOMSTEMMOD ,
  FCID_DISTANCEPREFS , FCID_DOTMOD , FCID_ENCLOSURE , FCID_ENDINGREPEAT ,
  FCID_ENIGMATEXTSTYLE , FCID_ENTRYALTERMOD , FCID_EXECUTABLESHAPEDEF , FCID_EXPRESSION ,
  FCID_FONTINFO , FCID_FONTPREFS , FCID_FREEZESYSTEM , FCID_FRETBOARDSTYLEDEF ,
  FCID_FRETBOARDSTYLEDEFS , FCID_FRETBOARDGROUPDEF , FCID_FRETBOARDGROUPDEFS , FCID_FRETINSTRUMENTDEF ,
  FCID_GENERALPREFS , FCID_GRIDSGUIDESPREFS , FCID_GROUP , FCID_GROUPNAMEPOSITIONPREFS ,
  FCID_HUMANPLAYBACKPREFS , FCID_INDEPENDENTCELLDETAIL , FCID_INSTRUMENTDEF , FCID_INSTRUMENTPLAYBACKDATA ,
  FCID_KEYMODEDEF , FCID_KEYSIGNATURE , FCID_LAYERPREFS , FCID_LYRICSBASELINE ,
  FCID_LYRICSPREFS , FCID_MEASURE , FCID_MEASURENUMBERREGION , FCID_METATOOLASSIGNMENT ,
  FCID_MIDIEXPRESSION , FCID_MISCDOCPREFS , FCID_MULTIMEASUREREST , FCID_MULTIMEASURERESTPREFS ,
  FCID_MULTISTAFFINSTRUMENT , FCID_MULTISTAFFINSTRUMENTS , FCID_MUSICCHARACTERPREFS , FCID_MUSICSPACINGPREFS ,
  FCID_NUMBER , FCID_NOTEHEADMOD , FCID_OTHERINCI , FCID_PERCUSSIONLAYOUTNOTE ,
  FCID_PERCUSSIONSTAFF , FCID_PERFORMANCEMOD , FCID_PAGE , FCID_PAGEFORMATPREFS ,
  FCID_PAGEGRAPHIC , FCID_PAGETEXT , FCID_PART , FCID_PARTEXTRACTPREFS ,
  FCID_PARTSCOPEPREFS , FCID_PARTSTAFFVOICING , FCID_PERCUSSIONNOTEMOD , FCID_PIANOBRACEPREFS ,
  FCID_PLAYBACKPREFS , FCID_RAWTEXT , FCID_REPEATPREFS , FCID_SECONDARYBEAMBREAKMOD ,
  FCID_BEAMEXTENSIONMOD , FCID_SECTIONSYLLABLE , FCID_SEPARATEMEASURENUMBER , FCID_SEPARATEPLACEMENT ,
  FCID_SHAPEDEF , FCID_SHAPEEXPRESSIONDEF , FCID_SLURCONTOURPREFS , FCID_SIZEPREFS ,
  FCID_SMARTSHAPE , FCID_SMARTSHAPEENTRYMARK , FCID_SMARTSHAPEMEASUREMARK , FCID_SMARTSHAPEPREFS ,
  FCID_STAFF , FCID_STAFFLIST , FCID_STAFFNAMEPOSITION , FCID_STAFFNAMEPOSITIONPREFS ,
  FCID_STAFFSTYLEASSIGN , FCID_STAFFSTYLEDEF , FCID_STAFFSYSTEM , FCID_STEMCONNECTIONTABLE ,
  FCID_STEMMOD , FCID_STRING , FCID_SYLLABLEENTRYMOD , FCID_SYSTEMSTAFF ,
  FCID_TABLATURENOTEMOD , FCID_TEMPOELEMENT , FCID_TEXTBLOCK , FCID_TEXTEXPRESSIONDEF ,
  FCID_TEXTREPEAT , FCID_TEXTREPEATDEF , FCID_TIEMOD , FCID_TIEPREFS ,
  FCID_TIECONTOURPREFS , FCID_TIEPLACEMENTPREFS , FCID_TIMESIGNATURE , FCID_TUPLET ,
  FCID_TUPLETPREFS , FCID_VERSESYLLABLE
}
 Constants for the GetClassID method. More...
 
enum  MEASUREMENTUNITS {
  MEASUREMENTUNIT_DEFAULT = UNIT_DEFAULT , MEASUREMENTUNIT_EVPUS = UNIT_EVPUS , MEASUREMENTUNIT_INCHES = UNIT_INCHES , MEASUREMENTUNIT_CENTIMETERS = UNIT_CENTS ,
  MEASUREMENTUNIT_POINTS = UNIT_POINTS , MEASUREMENTUNIT_PICAS = UNIT_PICAS , MEASUREMENTUNIT_SPACES = UNIT_SPACES , MEASUREMENTUNIT_MILLIMETERS = 100
}
 Constants for Finale's standard measurement units. More...
 

Public Member Functions

const char * ClassName () const override
 Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child class. More...
 
const PDKFRAMEWORK_CLASSID GetClassID () const override
 Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has problems to resolve the true classes of inherited objects. More...
 
 FCFontInfo ()
 Default constructor. This constructor does not add the font to the current document. However, if you call any method that requires the internal font ID, the font will be added to the current document when that method is called, if it is not already there. (See the detailed description of FCFontInfo for more information.) More...
 
 FCFontInfo (const FCString &name, double size, FLAG_16 enigmastyles=ENIGMASTYLE_PLAIN)
 Constructor with name and size and optional styles. This constructor adds the font to the current document if it is not already there, so you must manage the undo block appropriately when using this constructor. More...
 
 FCFontInfo (const ETextStyle &style)
 internal constructor.

 
void CopyFrom (const FCFontInfo *pInfo)
 Copies data from another font info object. More...
 
FCFontInfoCreateCopy ()
 Creates a copy of the font info object on the heap. More...
 
bool LoadFontPrefs (int prefsID)
 Sets the font information to any of the preference fonts. More...
 
bool SaveFontPrefs (int prefsID)
 Saves the font information to any of the preference fonts. More...
 
int GetSize () const
 Returns the font size as an integer number. More...
 
double GetSizeFloat () const
 Returns the font size as a floating point (with decimal digits). More...
 
void GetNameString (FCString *pString) const
 Gets the font name and puts it in a FCString object. More...
 
std::string GetName () const
 Gets the font name (const C-string version). More...
 
EFONTID GetIDByName () const
 Gets the internal Enigma font ID for the current document by searching for the font name. The value in GetFontID is used only to determine if this instance refers to the Default Music Font. If so, the font ID of the Default Music Font is returned (which is always zero in any document). More...
 
EFONTID GetNameByID () const
 Legacy version of GetIDByName with incorrect name. More...
 
FLAG_16 GetEnigmaStyles () const
 Gets the font style as standard Enigma bit storage. More...
 
bool MakeEnigmaString (FCString *pString, FCString *pFontTagString=NULL)
 Creates an Enigma string (for use in raw strings) based on the current font information. More...
 
FCStringCreateEnigmaString (FCString *pFontTagString=NULL)
 Returns a created FCString object that contains the font information as an Enigma string. More...
 
void MakeEnigmaStyleString (FCString *pString)
 Makes an Enigma string (for use in raw strings) based on only the current font style information. More...
 
void MakeEnigmaSizeString (FCString *pString)
 Makes an Enigma string (for use in raw strings) based on only the current font size information. More...
 
FCStringCreateEnigmaStyleString ()
 Creates a FCString object and creates the Enigma font style info string, based on only the current font style information. More...
 
bool ParseEnigmaCommand (FCString *pString)
 Parses a valid Enigma font command and changes the font information accordingly. More...
 
void ParseEnigmaFont (const EEnigmaFont *pEnigmaFont)
 Transfers the info from a Finale-internal font structure to the FCFontInfo object.
 
void SetEnigmaStyles (FLAG_16 fontstyles)
 Sets the font style as standard Enigma bit storage. More...
 
FCStringCreateDescription () const
 
void SetName (const std::string &pszName)
 Sets the font name. More...
 
EFONTID GetFontID () const
 Gets the internal document-specific font ID. It may not yet have been assigned a value, depending on which constructor you used. Unless you have a specific reason to inspect the current value, it is safer to use GetIDByName to get the internal font ID. Note, however, that GetIDByName modifies the document by adding the font to it, if the font is not currently in the document. More...
 
void SetFontID (EFONTID fontID)
 Sets the internal document-specific font ID. More...
 
void SetNameString (const FCString &value)
 Sets the font name (FCString version). More...
 
void SetNameByID (EFONTID id)
 Sets the font name by using the document's internal Enigma font ID. More...
 
void SetSize (int fontsize)
 Sets the font size as an integer value. More...
 
void SetSizeFloat (double fontsize)
 Sets the font size as a floating point (with decimal digits) value. More...
 
void SetAbsolute (bool state)
 Sets the absolute (fixed font) size state of the font info. More...
 
void SetStrikeOut (bool state)
 Sets the strikeout state of the font info. More...
 
void SetBold (bool state)
 Sets the boldface attribute of the font info. More...
 
void SetHidden (bool state)
 Sets the hidden state of the font info. More...
 
void SetItalic (bool state)
 Sets the italics attribute of the font info. More...
 
void SetUnderline (bool state)
 Sets the underline attribute of the font info. More...
 
void SetPlain ()
 Clears the styles so the font doesn't use any style. More...
 
bool IsName (const char *pszTestName) const
 Checks if the font name is a perfect match to the C-string test string. More...
 
bool IsNameString (const FCString &pTestName) const
 Checks if the font name is a perfect match to the test string. More...
 
bool IsPlain ()
 Returns true if the font has no special style flags. More...
 
bool GetBold () const
 Returns true if the font style is boldface. More...
 
bool GetItalic () const
 Returns true if the font style is italic. More...
 
bool GetUnderline () const
 Returns true if the font style is underline. More...
 
bool GetStrikeOut () const
 Returns true if the font style is strikeout. More...
 
bool GetAbsolute () const
 Returns true if the font size is absolute. More...
 
bool GetHidden () const
 Returns true if the font style is hidden (don't print). More...
 
bool GetIsSMuFLFont () const
 Returns true if the font is a SMuFL font. More...
 
bool IsMacSymbolFont () const
 returns true i the font is a Mac Symbol font. More...
 
bool IsIdenticalTo (const FCFontInfo &compareWith) const
 Returns true if all font information is identical to the compared object. More...
 
bool MakeDefaultMusicFont ()
 Changes the document's default music font to match this instance of FCFontInfo and modifies this instance to be the default music font (if successful). More...
 
double CalcAverageRomanCharacterWidthEVPUs () const
 Calculates the average width of the roman characters in the font in EVPUs. More...
 
double CalcAverageRomanCharacterWidthPoints () const
 Calculates the average width of the roman characters in the font in points. More...
 
void DebugDump () override
 Outputs the class data/information for debugging purposes. More...
 
- Public Member Functions inherited from __FCBase
virtual ~__FCBase ()
 Virtual destructor, so all inherited classes get the virtual destructor.
 
void DebugMsgInt (const char *pszPrefixText, int i)
 Creates a simple Message Box for debug purposes. The text appears with the extra digit (in decimal presentation) appearing afterwards. More...
 
void DebugMsgHex (const char *pszPrefixText, int i)
 Creates a simple Message Box for debug purposes. The text appears with the extra digit (as a hexadecimal number) appearing afterwards. More...
 
void DebugMsgString (const char *pszPrefixText, const char *thestring)
 Creates a simple Message Box for debug purposes. The text appears with the extra string appearing afterwards. More...
 
void DebugMsg (const char *pszMsg)
 Creates a simple Message Box for debug purposes with just one text string. More...
 
void DebugOutMenuInfo (FCUI *pUI, int menuixd_horiz, int menuixd_vert) const
 Outputs the menu command info for debugging purposes. More...
 
int DebugOutFormat (const char *fmt,...)
 Outputs debug text using C style "printf" syntax. More...
 
virtual void DebugDataDump ()
 Outputs a memory dump of the data block in the object for debugging purposes. More...
 
virtual void DebugDataByteArrayDump ()
 Outputs a memory dump of the data block in the object for debugging purposes, as a C++ byte array. More...
 
void Set16BitFlag (FLAG_16 *flag, FLAG_16 flagbits, bool state)
 Sets a 16 bit flag. More...
 
void Set32BitFlag (FLAG_32 *flag, FLAG_32 flagbits, bool state)
 Sets/resets a 32 bit flag, by using a bit mask. More...
 
bool GetBitFlag (FLAG_32 flag, FLAG_32 flagbits) const
 Gets a state from flag bits. Returns true if any bit in the mask is set. More...
 
int GetBitCount (FLAG_32 flag)
 Returns the total number of set bits in a 32-bit unsigned int.
 
void SetSpecific32Bit (FLAG_32 *flag, int bitnumber, bool state)
 Sets/resets a single bit in a 32 bit flag, by specifying one specific bit. More...
 
void SetUserData (void *pData)
 Sets the user data attached to the instance of an object. More...
 
void SetUserData2 (void *pData)
 Sets the additional user data attached to the instance of an object. More...
 
void * GetUserData () const
 Gets the user data attached to the instance of an object. More...
 
void * GetUserData2 () const
 Gets the additional user data attached to the instance of an object. More...
 
virtual bool IsIdentical (const __FCBase *pCompareObject) const
 Returns true if the data in the passed object is considered to be identical to the current object, otherwise false. More...
 
void StoreXML_String (tinyxml2::XMLElement *pParentNode, const char *pszElementName, FCString *pStringValue)
 Helper function to store FCString objects in the XML file. More...
 
void StoreXML_Integer (tinyxml2::XMLElement *pParentNode, const char *pszElementName, int value)
 Helper function to store integer objects in the XML file. More...
 
void StoreXML_Bool (tinyxml2::XMLElement *pParentNode, const char *pszElementName, bool value)
 Helper function to store boolean objects in the XML file. More...
 
void StoreXML_StringAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, FCString *pStringValue)
 Helper function to store FCString objects in the XML file, as an attribute to a node. More...
 
void StoreXML_IntegerAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, int value)
 Helper function to store integer objects in the XML file, as an attribute to a node. More...
 
void StoreXML_BoolAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, bool value)
 Helper function to store boolean objects in the XML file, as an attribute to a node. More...
 
void StoreXML_FloatAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, float value)
 Helper function to store floating point objects in the XML file, as an attribute to a node. More...
 
virtual void StoreToXML (tinyxml2::XMLElement *pParentNode)
 Virtual method that is used to store an object's data. More...
 
bool ReadXML_String (tinyxml2::XMLElement *pParentNode, const char *pszElementName, FCString *pStringValue)
 Helper method to read FCString objects from the XML file. More...
 
bool ReadXML_Integer (tinyxml2::XMLElement *pParentNode, const char *pszElementName, int *pValue)
 Helper method to read integer objects from the XML file. More...
 
bool ReadXML_Bool (tinyxml2::XMLElement *pParentNode, const char *pszElementName, bool *pValue)
 Helper method to read boolean objects from the XML file. More...
 
bool ReadXML_StringAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, FCString *pStringValue)
 Helper method to read FCString objects from the XML file, as an attribute to a node. More...
 
bool ReadXML_IntegerAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, int *pValue)
 Helper method to read integer objects from the XML file, as an attribute to a node. More...
 
bool ReadXML_BoolAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, bool *pValue)
 Helper method to read boolean objects from the XML file, as an attribute to a node. More...
 
bool ReadXML_FloatAttribute (tinyxml2::XMLElement *pNode, const char *pszAttributeName, float *pValue)
 Helper method to read floating point objects from the XML file, as an attribute to a node. More...
 
virtual bool ReadFromXML (tinyxml2::XMLElement *pParentNode)
 Virtual method that is used to read object data. More...
 

Static Public Member Functions

static fourbyte GetSystemTextEncoding ()
 Returns the internal Engima encoding number for the running Finale version. This value is appended to the font in Enigma strings. More...
 
- Static Public Member Functions inherited from __FCBase
static void DebugOutPtr (const char *pszPrefixText, void *ptr)
 Static method that outputs a line for debugging purposes. The prefix text appears with the extra ptr (in hexadeximal representation) appearing afterwards. More...
 
static void DebugOutInt (const char *pszPrefixText, int i)
 Static method that outputs a line for debugging purposes. The text appears with the extra digit (in decimal presentation) appearing afterwards. More...
 
static void DebugOutFloat (const char *pszPrefixText, double f)
 Static method that outputs a line for debugging purposes. The text appears with the extra float value appearing afterwards. More...
 
static void DebugOutTag (const char *pszPrefixText, EXTAG extag)
 Static method that outputs a line for debugging purposes. The text appears with the EXTAG (in text) appearing afterwards. More...
 
static void DebugOutHex (const char *pszPrefixText, int i)
 Static method that outputs a line for debugging purposes. The text appears with the extra digit (in hexadecimal presentation) appearing afterwards. More...
 
static void DebugOutBin (const char *pszPrefixText, int i)
 Static method that outputs a line for debugging purposes. The text appears with the extra digit (in binary presentation) appearing afterwards. More...
 
static void DebugOutString (const char *pszPrefixText, const char *thestring)
 Static method that outputs a line for debugging purposes (C string version). The text appears with the extra string appearing afterwards. More...
 
static void DebugOutString (const char *pszPrefixText, FCString *pString)
 Static method that outputs a line for debugging purposes (FCString version). The text appears with the extra string appearing afterwards. More...
 
static void DebugOutBool (const char *pszPrefixText, bool state)
 Static method that outputs a line for debugging purposes. The boolean state appears afterwards as either "TRUE" or "FALSE". More...
 
static void DebugOutBlock (const void *pBuffer, int startoffset, int size)
 Static method that outputs a memory block for debugging purposes. Eight bytes per line will appear (as hex digits) until the whole memory block is dumped. More...
 
static void DebugOutByteArrayBlock (const void *pBuffer, int startoffset, int size)
 Static method that outputs a memory block for debugging purposes. Eight bytes per line will appear (as hex digits) as a C++ onebyte array, until the whole memory block is dumped. More...
 
static void DebugOut (const char *pszLine)
 Static method to output a line of text for debugging purposes. More...
 

Additional Inherited Members

- Protected Member Functions inherited from __FCBase
 __FCBase ()
 The constructor.
 

Detailed Description

Class for document-independent font information.

Finale documents maintain a list of internal font IDs which are specific to that document. These font IDs are required for most font operations within the document. For example "Time New Roman" may have font ID 7 in one document and 11 in another. It appears that Finale assigns the ID values as fonts are referenced by the document.

This has the consequence that any time the ID is required, the font may be added to the document to obtain the ID. This can result in an unexpected modification of the document that must be managed as part of an Undo block. Note that all Lua scripts have an automatic Undo block in the main execution path, but you must decide whether to save the document with the font added or roll the changes back by canceling the Undo block. (A true setting for either HandlesUndo or NoStore in the finaleplugin namespace causes an automatic rollback.)

Examples of methods and functions that require the internal font ID include (but are not limited to)

Member Enumeration Documentation

◆ ENIGMASTYLES

Constants for enigma styles. These are bit-sensitve values that can be combined with bitwise-or.

Lua-supported (0.69)

Enumerator
ENIGMASTYLE_PLAIN 

Plain

ENIGMASTYLE_BOLD 

Bold

ENIGMASTYLE_ITALIC 

Italic

ENIGMASTYLE_UNDERLINE 

Underline

ENIGMASTYLE_STRIKEOUT 

Strikeout

ENIGMASTYLE_ABSOLUTE 

Absolute

ENIGMASTYLE_HIDDEN 

Hidden

Constructor & Destructor Documentation

◆ FCFontInfo() [1/2]

FCFontInfo::FCFontInfo ( )

Default constructor. This constructor does not add the font to the current document. However, if you call any method that requires the internal font ID, the font will be added to the current document when that method is called, if it is not already there. (See the detailed description of FCFontInfo for more information.)

Defaults to 12 point Times New Roman.

Lua-supported.

◆ FCFontInfo() [2/2]

FCFontInfo::FCFontInfo ( const FCString name,
double  size,
FLAG_16  enigmastyles = ENIGMASTYLE_PLAIN 
)

Constructor with name and size and optional styles. This constructor adds the font to the current document if it is not already there, so you must manage the undo block appropriately when using this constructor.

Lua-supported (0.68).

Parameters
nameThe name of the font. For Lua callers, this may be a Lua string.
sizeThe size of the font.
enigmastyles(optional) a bitwise combination of ENIGMASTYLES values for the font. Defaults to ENIGMASTYLE_PLAIN.

Member Function Documentation

◆ CalcAverageRomanCharacterWidthEVPUs()

double FCFontInfo::CalcAverageRomanCharacterWidthEVPUs ( ) const

Calculates the average width of the roman characters in the font in EVPUs.

Warning
This function uses FCTextMetrics to get the width of characters. Loading FCTextMetrics only works if a document is loaded. If you attempt to call this function from Lua when a document is not loaded, it throws a runtime error. C++ clients get 0 returned.

Lua-supported (0.68).

Returns
average width in EVPU or zero if not document is loaded.

◆ CalcAverageRomanCharacterWidthPoints()

double FCFontInfo::CalcAverageRomanCharacterWidthPoints ( ) const
inline

Calculates the average width of the roman characters in the font in points.

Warning
This function uses FCTextMetrics to get the width of characters. Loading FCTextMetrics only works if a document is loaded. If you attempt to call this function from Lua when a document is not loaded, it throws a runtime error. C++ clients get 0 returned.

Lua-supported (0.68).

Returns
average width in points or zero if not document is loaded. These are true 72 dpi points on either Windows or macOS.

◆ ClassName()

const char * FCFontInfo::ClassName ( ) const
inlineoverridevirtual

Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child class.

Lua-supported.

Implements __FCBase.

◆ CopyFrom()

void FCFontInfo::CopyFrom ( const FCFontInfo pInfo)

Copies data from another font info object.

Lua-supported.

◆ CreateCopy()

FCFontInfo * FCFontInfo::CreateCopy ( )
inline

Creates a copy of the font info object on the heap.

The caller must remove the created object from the heap after use.

Returns
The created object.

◆ CreateDescription()

FCString * FCFontInfo::CreateDescription ( ) const

Returns an FCString containing the description of the font.

C++ callers must dispose of the string using either delete or a smart pointer.

Lua-supported (0.68)

◆ CreateEnigmaString()

FCString * FCFontInfo::CreateEnigmaString ( FCString pFontTagString = NULL)

Returns a created FCString object that contains the font information as an Enigma string.

The resulting Enigma string contains tags for font name, size and style.

It's the caller's responsibility to clean up the object after use.

Lua-supported.

Parameters
pFontTagString(optional) the tag to use for the font tag. If omitted or NULL, then "^font" is used.
Returns
the created string containg the font name, size, and style tags.

◆ CreateEnigmaStyleString()

FCString * FCFontInfo::CreateEnigmaStyleString ( )

Creates a FCString object and creates the Enigma font style info string, based on only the current font style information.

The caller must delete the created object from the heap after use.

Lua-supported.

◆ DebugDump()

void FCFontInfo::DebugDump ( )
overridevirtual

Outputs the class data/information for debugging purposes.

Accessible if PDK_FRAMEWORK_DEBUG is defined.

When child class inherit this method to output the contents of its own members, it should call the parent before providing its own output.

Reimplemented from __FCBase.

◆ GetAbsolute()

bool FCFontInfo::GetAbsolute ( ) const
inline

Returns true if the font size is absolute.

Lua-supported (also as property).

◆ GetBold()

bool FCFontInfo::GetBold ( ) const
inline

Returns true if the font style is boldface.

Lua-supported (also as property).

◆ GetClassID()

const PDKFRAMEWORK_CLASSID FCFontInfo::GetClassID ( ) const
inlineoverridevirtual

Returns the internal class ID for the PDK Framework class. This is implemented mostly because Lua has problems to resolve the true classes of inherited objects.

This method must be overwritten by all child classes.

Lua-supported (also read-only property) (0.55).

Reimplemented from __FCBase.

◆ GetEnigmaStyles()

FLAG_16 FCFontInfo::GetEnigmaStyles ( ) const
inline

Gets the font style as standard Enigma bit storage.

Lua-supported (also as property).

Returns
A bitwise combination of ENIGMASTYLES values.

◆ GetFontID()

EFONTID FCFontInfo::GetFontID ( ) const
inline

Gets the internal document-specific font ID. It may not yet have been assigned a value, depending on which constructor you used. Unless you have a specific reason to inspect the current value, it is safer to use GetIDByName to get the internal font ID. Note, however, that GetIDByName modifies the document by adding the font to it, if the font is not currently in the document.

See further comments at SetFontID.

Lua-supported (also as property) (0.72)

Returns
the internal font ID.

◆ GetHidden()

bool FCFontInfo::GetHidden ( ) const
inline

Returns true if the font style is hidden (don't print).

Lua-supported (also as property).

◆ GetIDByName()

EFONTID FCFontInfo::GetIDByName ( ) const

Gets the internal Enigma font ID for the current document by searching for the font name. The value in GetFontID is used only to determine if this instance refers to the Default Music Font. If so, the font ID of the Default Music Font is returned (which is always zero in any document).

Note that GetIDByName does not modify the internal font number of the current instance. You can use GetIDByName reliably to assign properties of an FCFontInfo from one document to an instance from another. This is not guaranteed to work for GetFontID.

Warning
If the current Finale document does not contain the font specified by the name, this function adds it to the document.

Lua-supported (0.72).

Returns
the document-specific font number for the current instance.

◆ GetIsSMuFLFont()

bool FCFontInfo::GetIsSMuFLFont ( ) const
inline

Returns true if the font is a SMuFL font.

Only supported when running Finale 27.1 or higher. For any version of Finale lower than this, this method always returns false.

Lua-supported (also as read-only property) (0.59).

◆ GetItalic()

bool FCFontInfo::GetItalic ( ) const
inline

Returns true if the font style is italic.

Lua-supported (also as property).

◆ GetName()

std::string FCFontInfo::GetName ( ) const

Gets the font name (const C-string version).

Lua-supported (also as property).

Returns
The font name. Starting with version 0.73 this is UTF8-encoded.

◆ GetNameByID()

EFONTID FCFontInfo::GetNameByID ( ) const
inline

Legacy version of GetIDByName with incorrect name.

Deprecated:
Use GetIDByName instead.

Lua-supported.

◆ GetNameString()

void FCFontInfo::GetNameString ( FCString pString) const

Gets the font name and puts it in a FCString object.

On Finale 25, this method supports Unicode font names.

Lua-supported.

Parameters
pStringPointer to a FCString object. If the value is NULL, nothing happens.

◆ GetSize()

int FCFontInfo::GetSize ( ) const
inline

Returns the font size as an integer number.

Lua-supported (also as property).

Returns
The font size in points.

◆ GetSizeFloat()

double FCFontInfo::GetSizeFloat ( ) const
inline

Returns the font size as a floating point (with decimal digits).

Lua-supported (also as property).

Returns
The font size in points, with decimal digits if needed.

◆ GetStrikeOut()

bool FCFontInfo::GetStrikeOut ( ) const
inline

Returns true if the font style is strikeout.

Lua-supported (also as property).

◆ GetSystemTextEncoding()

fourbyte FCFontInfo::GetSystemTextEncoding ( )
static

Returns the internal Engima encoding number for the running Finale version. This value is appended to the font in Enigma strings.

Lua-supported.

Returns
-1 means "unknown encoding". -2 means error. Otherwise the encoding number.

◆ GetUnderline()

bool FCFontInfo::GetUnderline ( ) const
inline

Returns true if the font style is underline.

Lua-supported (also as property).

◆ IsIdenticalTo()

bool FCFontInfo::IsIdenticalTo ( const FCFontInfo compareWith) const

Returns true if all font information is identical to the compared object.

Lua-supported.

◆ IsMacSymbolFont()

bool FCFontInfo::IsMacSymbolFont ( ) const

returns true i the font is a Mac Symbol font.

Remarks
Both Windows and Mac operating systems use Mac Symbol fonts. They are listed in MacSymbolFonts.txt in the Configuration Files folder. (See Finale preferences.)

Lua-supported (0.72)

◆ IsName()

bool FCFontInfo::IsName ( const char *  pszTestName) const

Checks if the font name is a perfect match to the C-string test string.

Lua-supported.

Parameters
pszTestNamePointer to the font name to test for. Starting with version 0.73, this should be UTF-8 encoded.
Returns
True if the test font string matches font name.

◆ IsNameString()

bool FCFontInfo::IsNameString ( const FCString pTestName) const

Checks if the font name is a perfect match to the test string.

Lua-supported.

Parameters
pTestNameReference to the FCString object to test.
Returns
True if the test font string matches font name.

◆ IsPlain()

bool FCFontInfo::IsPlain ( )
inline

Returns true if the font has no special style flags.

Lua-supported.

◆ LoadFontPrefs()

bool FCFontInfo::LoadFontPrefs ( int  prefsID)

Sets the font information to any of the preference fonts.

This method handles the FCFontPrefs data in the background.

Lua-supported.

Parameters
prefsIDAny of the FONTPREF_* constants.
Returns
True if the font was loaded successfully from the preferences.

◆ MakeDefaultMusicFont()

bool FCFontInfo::MakeDefaultMusicFont ( )

Changes the document's default music font to match this instance of FCFontInfo and modifies this instance to be the default music font (if successful).

Lua-supported.

Returns
true if success

◆ MakeEnigmaSizeString()

void FCFontInfo::MakeEnigmaSizeString ( FCString pString)

Makes an Enigma string (for use in raw strings) based on only the current font size information.

PDK_FRAMEWORK_ENIGMASTRINGS must be defined at compile time.

Lua-supported.

Parameters
pStringPointer to the FCString object where the result will be put.

◆ MakeEnigmaString()

bool FCFontInfo::MakeEnigmaString ( FCString pString,
FCString pFontTagString = NULL 
)

Creates an Enigma string (for use in raw strings) based on the current font information.

The Enigma string contains tags for font name, size and style.

Lua-supported.

Returns
True on success.
Parameters
pStringThe string object to put the result in.
pFontTagStringOptional parameter, that contains a specific font tag with '^' but without '('. Example: ^fontTxt. If this parameter isn't defined, the "^font()" Enigma tag will be used.

◆ MakeEnigmaStyleString()

void FCFontInfo::MakeEnigmaStyleString ( FCString pString)

Makes an Enigma string (for use in raw strings) based on only the current font style information.

PDK_FRAMEWORK_ENIGMASTRINGS must be defined at compile time.

Lua-supported.

Parameters
pStringPointer to the FCString object where the result will be put.

◆ ParseEnigmaCommand()

bool FCFontInfo::ParseEnigmaCommand ( FCString pString)

Parses a valid Enigma font command and changes the font information accordingly.

Lua-supported.

Parameters
pStringPointer to a FCString object containing one command.
Returns
True if the string was recognized and parsed.

◆ SaveFontPrefs()

bool FCFontInfo::SaveFontPrefs ( int  prefsID)

Saves the font information to any of the preference fonts.

This method handles the FCFontPrefs data in the background.

Lua-supported.

Parameters
prefsIDAny of the FONTPREF_* constants.
Returns
True if the font was saved successfully back to the preferences.

◆ SetAbsolute()

void FCFontInfo::SetAbsolute ( bool  state)
inline

Sets the absolute (fixed font) size state of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set the absolute font size state. False to set to relative state.

◆ SetBold()

void FCFontInfo::SetBold ( bool  state)
inline

Sets the boldface attribute of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set the boldface font attribute. False to set to normal state.

◆ SetEnigmaStyles()

void FCFontInfo::SetEnigmaStyles ( FLAG_16  fontstyles)
inline

Sets the font style as standard Enigma bit storage.

Lua-supported (also as property).

Parameters
fontstylesA bitwise combination of ENIGMASTYLES values.

◆ SetFontID()

void FCFontInfo::SetFontID ( EFONTID  fontID)
inline

Sets the internal document-specific font ID.

Remarks
The internal font ID for a given font varies from document to document. Furthermore, it need not always be assigned a value, since most methods and properties of FCFontInfo recalculate it every time (for cross-document support). However, it can be useful when working within a specific document, especially when working with a font that is also assigned as the default music font.

Lua-supported (also as property) (0.72)

Parameters
fontIDThe internal font ID.

◆ SetHidden()

void FCFontInfo::SetHidden ( bool  state)
inline

Sets the hidden state of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set the hidden state. False to set to visible state.

◆ SetItalic()

void FCFontInfo::SetItalic ( bool  state)
inline

Sets the italics attribute of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set the italics font attribute. False to set to normal state.

◆ SetName()

void FCFontInfo::SetName ( const std::string &  pszName)

Sets the font name.

Lua-supported (also as property).

Parameters
pszNameThe C-style string name. Starting with version 0.73 this can (and should) be UTF8-encoded.

◆ SetNameByID()

void FCFontInfo::SetNameByID ( EFONTID  id)

Sets the font name by using the document's internal Enigma font ID.

Lua-supported.

◆ SetNameString()

void FCFontInfo::SetNameString ( const FCString value)

Sets the font name (FCString version).

Lua-supported.

◆ SetPlain()

void FCFontInfo::SetPlain ( )
inline

Clears the styles so the font doesn't use any style.

Lua-supported.

◆ SetSize()

void FCFontInfo::SetSize ( int  fontsize)
inline

Sets the font size as an integer value.

Lua-supported (also as property).

Parameters
fontsizeThe font size in points, as an integer.

◆ SetSizeFloat()

void FCFontInfo::SetSizeFloat ( double  fontsize)
inline

Sets the font size as a floating point (with decimal digits) value.

Lua-supported (also as property).

Parameters
fontsizeThe font size in points, with decimal digits if necessary.

◆ SetStrikeOut()

void FCFontInfo::SetStrikeOut ( bool  state)
inline

Sets the strikeout state of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set to strikeout. False to set to normal.

◆ SetUnderline()

void FCFontInfo::SetUnderline ( bool  state)
inline

Sets the underline attribute of the font info.

Lua-supported (also as property).

Parameters
stateTrue to set the underline font attribute. False to set to normal state.