To control the location of the title you may want to set a custom font as explained here (by twaddington): Link
Then to relocate the position of the text, in updateMeasureState()
you would add p.baselineShift += (int) (p.ascent() * R);
Similarly in updateDrawState()
add tp.baselineShift += (int) (tp.ascent() * R);
Where R is double between -1 and 1.