Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Unicode block element support #430

Closed
wants to merge 1 commit into from
Closed

Conversation

gliljas
Copy link

@gliljas gliljas commented Nov 2, 2022

Summary

This PR implements support for rendering QR codes using the block elements available in Unicode. Two lines can be rendered as one, using FULL BLOCK, UPPER HALF BLOCK and LOWER HALF BLOCK. While it would also be possible to use the quadrant characters, reducing the string length even further, they are very rarely implemented in fonts.

The name Utf8QRCode is definitely up for discussion :)

@gliljas
Copy link
Author

gliljas commented Nov 2, 2022

I see now that this was also done in #384 . Didn't see it, since it was called ASCII, which it isn't :)

@codebude
Copy link
Owner

Hi @gliljas ,

thanks for your PR and the work you put into it. I reviewed your PR as also the aforementioned PR #384 and decided for the latter at the end.

Reason: I like the integration into the existing ASCIIQRCode more that having a another separate renderer with nearly the same use-case/output. Nevertheless your code was very inspiring and a took parts of your ideas into the codebase from #384. (E.g. the invert parameter as also the fixed size/capacity of the string builder.)
I mentioned in the release notes and hope this is fine for you: https://github.com/codebude/QRCoder/wiki/Release-Notes#150

Regarding the naming "ASCIIQRCode" and your note (it was called ASCII, which it isn't :)) on it, I added an explanation in the wiki which reads out as follows:

Trivia: The renderer is called Ascii renderer, although it uses characters from the Utf-8 character set by default. The idea behind this is that the renderer uses a text-based graphical representation that is reminiscent of classic Ascii art. Naming it Utf8QrCode was rejected in the design phase, as it would be difficult to deduce from this name what type of return value the renderer has.

I hope this helps to avoid confusion. :-)
Thanks again!

@codebude codebude closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants