@jhowell proposal to use .kfx and "float: snap-block" works, I was able to recreate your result(it works perfect with different font size):
BUT "float: snap-block" seems works only on <img> with <p> around it. As soon as you replace raw <img> with sth more complicated like <figure> or <svg>, everything backs to normal (ugly empty space). And problem with captions arise.
I try hack it by using <p> as replacement for <figcaption> but result disappoint me:
I try draw text/caption in <svg> but as I mentioned above "float: span-block" doesn't work with anything beside <img>.
Any ideas?