The important part is in method TCustomSpeedButton.MeasureDraw in file speedbutton.inc on line 675-681:
TextFlags := DT_LEFT or DT_TOP;
if UseRightToLeftReading then
TextFlags := TextFlags or DT_RTLREADING;
if Draw then
ThemeServices.DrawText(Canvas, DrawDetails, Caption, PaintRect,
TextFlags, 0);
All you need is to modify and add a case .. of construction:
case Alignment of
alTop: TextFlags := TextFlags or DT_TOP;
alRight: TextFlags := TextFlags or DT_RIGHT;
//etc. for other positions
end;
And test, test, test for all possible combinantions, i.e. with glyph, without glyph, LeftToRight, RightToLeft, glyph only (no caption) etc.