Verovio
Source code documentation
vrv::Glyph Class Reference

This class is used for storing a music font glyph. More...

#include <glyph.h>

Public Member Functions

void GetBoundingBox (int &x, int &y, int &w, int &h) const
 Get the bounds of the glyph.
 
void SetBoundingBox (double x, double y, double w, double h)
 Set the bounds of the glyph These are original values from the font and will be stored as (int)(10.0 * x) in the glyph.
 
void SetAnchor (std::string anchorStr, double x, double y)
 Add an anchor for the glyph. More...
 
bool HasAnchor (SMuFLGlyphAnchor anchor) const
 Check if the glyph has anchor provided.
 
const Point * GetAnchor (SMuFLGlyphAnchor anchor) const
 Return the SMuFL anchor for the glyph.
 
Constructors, destructors, and other standard methods
 Glyph ()
 
 Glyph (int unitsPerEm)
 
virtual ~Glyph ()
 
Setter and getter for the units per EM
int GetUnitsPerEm () const
 
void SetUnitsPerEm (int units)
 
Setter and getter for the code string
const std::string & GetCodeStr () const
 
void SetCodeStr (const std::string &codeStr)
 
Setter and getter for the horizAdvX
int GetHorizAdvX () const
 
void SetHorizAdvX (double horizAdvX)
 
Setter and getters for the face (see FontStore::FaceIdentity) and the glyph ID in the face
void SetFace (uint64_t faceIdentity, int glyphId)
 
uint64_t GetFaceIdentity () const
 
int GetGlyphId () const
 

Detailed Description

This class is used for storing a music font glyph.

All glyph values are integers. However, for keeping precision as high as possible, they are 10 times the original values. Since the unit per em value is also 10 times the original, there is no incident on calculations elsewhere. However, it does increase the precision because units are always multiplied by a point size before being divided by the unit per em. See Ex: 10.2 become 102, with a unit per em of 20480 (instead of 2048)

Member Function Documentation

◆ SetAnchor()

void vrv::Glyph::SetAnchor ( std::string  anchorStr,
double  x,
double  y 
)

Add an anchor for the glyph.

The string is turn into a SMuFLGlyphAnchor ("cutOutNE" => SMUFL_cutOutNE)


The documentation for this class was generated from the following file: