Skip to content

Neon‐Verovio Coordinate System Conversion

Yinan Zhou edited this page May 24, 2024 · 1 revision

Neon and Verovio have two different coordinate systems.

The coordinate system of Neon uses facsimile, in which the origin is in the top left corner, whereas the origin of Verovio coordinate system is in the bottom left corner. The conversion of the coordinate systems happens in Verovio.

When Verovio loads the MEI file from Neon, LoadData() calls SyncFromFacsimileFunctor to convert facsimile>surface>zone@ulx/uly/lrx/lry to DrawingX/Y later used in drawing methods to render glyphs. When exporting MEI files, GetMEI() in Verovio calls SyncToFacsimileFunctor to sync DrawingX/Y value to facsimile > surface > zone in MEI file.

coordinate_system 001

In editortoolkit_neume.cpp, if you need to do conversions for coordinate calculations, you can use ToLogicalX/Y() to convert facsimile value to DrawingX/Y value and ToDeviceContextX/Y() to convert DrawingX/Y value to facsimile value. If you need to modify zone@ulx/uly/lrx/lry, you can call m_doc->SyncFromFacsimileDoc() at the end of the editor action method.