> I don't understand the exact meaning of those numbers "0 2", but looks like that limits the number of
> characters to be displayed after "test:"?
No, it means that the face covers 2 characters starting with the first
one.
I don't think I understand all the complexity you've gone through,
because this works for me in the current emacs-26 branch:
(insert (format (propertize "%d" 'face 'font-lock-warning-face) 10))
How is this different from what you do?
Kaushal Modi