Skip to content

add glyph utf8 string as class attribute in svg export

The goal of this pull request is to add glyphs utf8 string to identify glyphs using the svg backend.

My final goal for this is to use cairo to extract both drawings and glyphs for tasks like OCR and OMR (optical music recognition). The ability to extract every drawing position and type is very useful to then train various model, etc.

I tried to make the smallest amount of change and decided to replace the show_glyphs callback of the svg backend to the show_text_glyphs callback so that the utf8 string information is kept. Finally, I store the utf8 string in the class attribute of the svg:use node referencing the glyph.

Merge request reports