How about a simple, single, CSS property that can simply say:
"horizontally center this text inside its rectangular element"
And another one for:
"vertically center this text inside its rectangular element"
The issue of centering wrapped multiline text has been solved in many UI libraries.