Python, 125.833 score
Attempt This Online! or Score this online!
Through some experimentation, I found that
\u200a (zero width space) takes up zero pixels. In addition, as kindly pointed out by Mukundan314,
\u200c seems to use up zero pixels as well, though only when surrounded by
\u200a. Using this fact, I created an algorithm to encode any string using only the characters
\u200a. The algorithm works by encoding each character as a string of
\u200cs whose size is the value of its unicode codepoint. Then, they are joined together by
Then, decoding it is simply a matter of splitting the string by the
\u200c delimiter, mapping each element to its length, and converting it back into a string using the
In the implementation, the strange-looking unicode characters are converted to ASCII due to Python's implicit NFKC normalization of identifiers, which help slightly shorten the pixel width.
Python, 139.097 score
-0.002 score thanks to @Neil, who noticed that the
\u200bs are apparently unnecessary here.
ᵉᵛªˡ(ᵇʸᵗᵉſ(ºʳᵈ(ˡ)%126for ˡ in'ֲًٌٍٍِّّ֑᷿͈ۘۚ︠̔ۘ̔̔ۛٓ̔̕ﱢٍَْ᷿ۘ̔ͬ̔ۛۙ̔᷾ۘ̔ﱡ̔ﱡٌُ֑۠۟̔︡'))
Attempt This Online!
An alternative solution, which although longer, may port better to other languages. The idea here is that any string of accent characters embedded between two
\u200bs has a pixel width of zero.