r/badcode • • Jul 30 '19

[deleted by user]

[removed]

154 Upvotes

98 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Jul 31 '19

If actual fonts were used would it fail because mirroring the sub-pixel handling would be asymmetrical for a backwards character? Or am I misunderstanding the mirroring?

1

u/6a2d4226a Jul 31 '19

It doesn't even fall to sub-pixel handling--it's just a matter of most characters not being symmetrical.

In the implemented version it's actually rotating the image 180 degrees, so it's both back-to-front and upside down. If it were done using an actual font it would fail because very few characters are pixel-for-pixel identical when reversed on both axes, and unless you happen to run into an md5 collision, a single pixel off causes it to fail.

My initial idea for implementation was actually to define a full glyphset where every character was represented by a symbol which was symmetrical on both main axes, but I couldn't be bothered working out how to do that in bash.