Functions

Score drawing and pages formating

Functions

GuidoErrCode GuidoOnDraw (GuidoOnDrawDesc *desc)
 Draws one page of score into a graphic device.
GuidoErrCode GuidoGR2SVG (const GRHandler handle, int page, std::ostream &out, bool embedFont, const char *font, const int mappingMode=0)
 Exports one page of score to SVG.
GuidoErrCode GuidoSVGExport (const GRHandler handle, int page, std::ostream &out, const char *fontfile, const int mappingMode=0) __attribute__((deprecated))
 Exports one page of score to SVG.
GuidoErrCode GuidoSVGExportWithFontSpec (const GRHandler handle, int page, std::ostream &out, const char *fontfile, const char *fontspec, const int mappingMode=0) __attribute__((deprecated))
 Exports one page of score to SVG. If fontfile or fontspec are set, the font is added to svg. The fontfile has priority over the fontspec.
GuidoErrCode GuidoAbstractExport (const GRHandler handle, int page, std::ostream &out)
 Exports an abstract representation of GUIDO draw commands.
GuidoErrCode GuidoBinaryExport (const GRHandler handle, int page, std::ostream &out)
 Exports an representation of GUIDO draw commands in a data-reduced dsl.
void GuidoDrawBoundingBoxes (int bbMap)
 Control bounding boxes drawing.
int GuidoGetDrawBoundingBoxes ()
 Gives bounding boxes drawing state.
void GuidoGetPageFormat (CGRHandler inHandleGR, int pageNum, GuidoPageFormat *format)
 Gives a score page format.
void GuidoSetDefaultPageFormat (const GuidoPageFormat *format)
 Sets the default score page format.
void GuidoGetDefaultPageFormat (GuidoPageFormat *format)
 Gives the default score page format.
float GuidoUnit2CM (float val)
 Converts internal Guido units into centimeters.
float GuidoCM2Unit (float val)
 Converts centimeters into internal Guido units.
float GuidoUnit2Inches (float val)
 Converts internal Guido units into inches.
float GuidoInches2Unit (float val)
 Converts inches into internal Guido units.
GuidoErrCode GuidoResizePageToMusic (GRHandler inHandleGR)
 Resize the page sizes to the music size.

Detailed Description

The GuidoEngine makes use of internal units for graphic operations. The functions that query or set graphic dimensions always makes use of this internal unit. Conversion functions are provided to convert to standard units.


Function Documentation

GuidoErrCode GuidoOnDraw ( GuidoOnDrawDesc desc )

Draws one page of score into a graphic device.

Parameters:
descinformations about what to draw and how to draw.
Returns:
a Guido error code
GuidoErrCode GuidoGR2SVG ( const GRHandler  handle,
int  page,
std::ostream &  out,
bool  embedFont,
const char *  font,
const int  mappingMode = 0 
)

Exports one page of score to SVG.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
embedFontif true, it use a embbed guido font and add it to the SVG.
fontpath of the guido svg font file or an svg font in text representation. Can be use if embedFont is set to false else it is unnecessary. If the library is compiled with INDEPENDENTSVG option, don't use a font file. The library cannot calculate font metric. You have better to use embedded font.
mappingModethe mapping mode (see mapping mode enum).
Returns:
a Guido error code
GuidoErrCode GuidoSVGExport ( const GRHandler  handle,
int  page,
std::ostream &  out,
const char *  fontfile,
const int  mappingMode = 0 
)

Exports one page of score to SVG.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
fontfilepath of the guido svg font file.
mappingModethe mapping mode (see mapping mode enum).
Returns:
a Guido error code
GuidoErrCode GuidoSVGExportWithFontSpec ( const GRHandler  handle,
int  page,
std::ostream &  out,
const char *  fontfile,
const char *  fontspec,
const int  mappingMode = 0 
)

Exports one page of score to SVG. If fontfile or fontspec are set, the font is added to svg. The fontfile has priority over the fontspec.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
fontfilepath of the guido svg font file.
fontspecan svg font in text representation.
mappingModethe mapping mode (see mapping mode enum).
Returns:
a Guido error code
GuidoErrCode GuidoAbstractExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
)

Exports an abstract representation of GUIDO draw commands.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns:
a Guido error code
GuidoErrCode GuidoBinaryExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
)

Exports an representation of GUIDO draw commands in a data-reduced dsl.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns:
a Guido error code
void GuidoDrawBoundingBoxes ( int  bbMap )

Control bounding boxes drawing.

Parameters:
bbMapa bits field indicating the set of bounding boxes to draw (default to none).
int GuidoGetDrawBoundingBoxes (  )

Gives bounding boxes drawing state.

void GuidoGetPageFormat ( CGRHandler  inHandleGR,
int  pageNum,
GuidoPageFormat format 
)

Gives a score page format.

Parameters:
inHandleGRa Guido opaque handle to a GR structure.
pageNuma page number.
formaton output: the page format
void GuidoSetDefaultPageFormat ( const GuidoPageFormat format )

Sets the default score page format.

The default page format is used when no \pageFormat tag is present. Parameters are Guido internal units. Default values for the default page format are:

  • paper size: A4
  • left margin: 2cm
  • right margin: 2cm
  • top margin: 5cm
  • bottom margin: 3cm
Parameters:
formatthe page format
void GuidoGetDefaultPageFormat ( GuidoPageFormat format )

Gives the default score page format.

Parameters:
formaton output: the page format
float GuidoUnit2CM ( float  val )

Converts internal Guido units into centimeters.

Parameters:
valthe value to be converted
Returns:
the converted value
float GuidoCM2Unit ( float  val )

Converts centimeters into internal Guido units.

Parameters:
valthe value to be converted
Returns:
the converted value
float GuidoUnit2Inches ( float  val )

Converts internal Guido units into inches.

Parameters:
valthe value to be converted
Returns:
the converted value
float GuidoInches2Unit ( float  val )

Converts inches into internal Guido units.

Parameters:
valthe value to be converted
Returns:
the converted value
GuidoErrCode GuidoResizePageToMusic ( GRHandler  inHandleGR )

Resize the page sizes to the music size.

Parameters:
inHandleGRa Guido opaque handle to a GR structure.
Returns:
a Guido error code.