After so many years and this is still not resolved?
this is what I come up with.. not perfect but quite useful for rudimentary buttons.
The hack uses text background color and constrained child as a mask, while an extra parent is used for the border as the immediate parent border is used for spacing.
There are two solutions I came up with, while only the hack on red button is kind of OK. Sure a dirty hack with lot of flaws .. like you cannot use gradients and so many features as if it would be done properly if such proper way would exists, meaning constrains between object no matter their child parent or what relation ships.. simple constrains as such. If you ever worked with CAD you would understand what real constrains means.
See the attached file
dynamic_button.afdesign