Geoserver legend label orientation for raster layer legends

Hi All,

I’m working on a legend graphic for a raster layer and I’ve been exploring the different legend options to get the legend to look like I want it to. All is working well so far, except for the fact that I can’t quite work out how to rotate the labels of the legend when I use the horizontal legend layout.
As it turns out, someone else has been asking a similar question on stackoverflow that illustrates my problem rather nicely:

Any help or advice would be much appreciated!