I want to use a custom modeBarButton too and choosed the download icon from fontawesome: http://fontawesome.io/icon/download/
I found the underlying svg here: https://github.com/encharm/Font-Awesome-SVG-PNG/blob/master/black/svg/download.svg
So I tried your example @etienne with that:
var icon = {
'width': 1792,
'path': 'M1344 1344q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm256 0q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm128-224v320q0 40-28 68t-68 28h-1472q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h465l135 136q58 56 136 56t136-56l136-136h464q40 0 68 28t28 68zm-325-569q17 41-14 70l-448 448q-18 19-45 19t-45-19l-448-448q-31-29-14-70 17-39 59-39h256v-448q0-26 19-45t45-19h256q26 0 45 19t19 45v448h256q42 0 59 39z',
'ascent': 1792,
'descent': 0,
};
I hope the choosed value for ascent, descent and width is correct - I was unsure.
But my problem is that the icon is flipped 180 degree. How I can avoid this?