Fix `string-pixel-width' with alternate text properties
Fix possible wrong result of `string-pixel-width' with alternate
and default properties. Create new regression tests.
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Like for
`face-remapping-alist', use in work buffer the value of
`char-property-alias-alist' and `default-text-properties'
local to the passed buffer, to correctly compute pixel width.
(Bug#77042)
* test/lisp/misc-tests.el: Add tests for `string-pixel-width'.
(cherry picked from commit
b1db48c0fcd438c903826fe0dba3bc28ffa73cc4)