markusfisch / BinaryEye

Yet another barcode scanner for Android
https://play.google.com/store/apps/details?id=de.markusfisch.android.binaryeye
MIT License
1.42k stars 117 forks source link

ASCII art is not displayed correctly #356

Closed Grafenea closed 1 year ago

Grafenea commented 1 year ago

I was doing some tests with QR Codes, one of them was to use them to store ASCII art, however when I scan them in Binary Eye they are displayed incorrectly.

Screenshot_20230215-195922

For comparison, look at the correct display.

Screenshot_20230215-195858

Here the sample Qr Code in case you wanted to solve the problem.

test

markusfisch commented 1 year ago

What a funny idea! 😉 I like this 👍

The reason for the distortion is that Binary Eye is using a monospace font where the space character is just as wide as any other character. So, when I copy the contents of your sample into a code black, which is also using a monospace font by default, your sample looks like this:

⠀           (\ __ /)
              (UwU)
       _ノ ヽ ノ\_ 
    / `/ ⌒Y⌒ Y  \
 (  (三ヽ人  /   |
| ノ⌒\  ̄ ̄ヽ  ノ
ヽ___>、__/
          |( 王 ノ〈 
           /ミ`ー―彡\ 
          |╰    ❨      ╯|   
          |       /\       |
          |      /  \      |
          |    /     \     |

Usually, and traditionally, ASCII Art is made for monospaced fonts because this is where it's usually used (in terminals, source code, things like that). Making ASCII Art in a proportional font makes the art font-specific because it then only works with certain fonts. Here's a more elaborate explanation: https://en.wikipedia.org/wiki/ASCII_art#Non_fixed-width_ASCII

Of course, if you convert this sample to a monospace version, it won't work for other apps that use a proportional font for the scanned contents like the one in the second screenshot 😬

Grafenea commented 1 year ago

Thanks for the help, the only thing I think can solve this problem is after scanning, in the three dot menu there could be an option to change the font. But I think it's a waste of time to have this option just to display an ASCII art correctly.