lewdlime / abcm2ps

abcm2ps is a command line program which converts ABC to music sheet in PostScript or SVG format. It is an extension of abc2ps which may handle many voices per staff. abcm2ps is Copyright © 2014-2016 Jean-Francois Moine.
http://moinejf.free.fr/
GNU General Public License v3.0
80 stars 31 forks source link

Work around for Qt's QSvgRenderer weakness. #80

Open be1 opened 3 years ago

be1 commented 3 years ago

Hello, Qt's QSvgRenderer does not render correctly SVG files generated by abcm2ps. See: https://bugreports.qt.io/browse/QTBUG-88494 But maybe you would like to cherry-pick this workaround: 630a2355ce0dc915578b18e3960603e4d34cfbb8 from https://github.com/be1/qabc.git (in the lib branch)...

moinejf commented 3 years ago

Hi, This does not work: you lose the 'currentColor'.

be1 commented 3 years ago

Hello, Even if that patch is a bad hack (sure), currentColor isn't anyway "black" ?

moinejf commented 3 years ago

No, it is not. Try that:

X:1
L:1/4
K:C
%%voicecolor red
CDEF|GABc|
be1 commented 3 years ago

Thanks for the hint. If I could see in the code where currentColor is changed, I could modify the patch. But it seems currentColor is never changed, for now: colors change are written directly as color or bgcolor attributes, as I can see. e.g:

svg.c:      fprintf(fout, "color:#%06x;", gcur.rgb)

But I understand this could change in future versions, and that, anyway, currentColor is a handy feature that should not be broken (by my patch). So I won't cry ;-)