Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of #22 I introduced the BitmapGRF class that was heavily based on another nodejs library. As it turns out the grayscale conversion method that library uses is far less tolerant of anti-aliasing or other effects that drawing to a canvas can generate.
The side-effect here was a hard to nail down issue with printed text looking awful. After lots of debugging I decided to revert the image conversion logic back to the color theory based version I wrote last year and this cleared up the issue. The threshold values now work much more effectively and have been returned back to the default 70% they used to be. Prints look much sharper and the font looks much crisper.
To facilitate the debugging I had modified the demo app to show the preview as rendered by the BitmapGRF class, which generates a much more "this is what the badge will actually print like" preview. I've decided to keep this as a good example of how the library ends up rendering text and images. The demo app is starting to get longer than I think is appropriate for a 'basic example code demo' and I'm considering forking it into an 'advanced test app' demo showing more features. This might include more sliders for text control, adding in full image files, and advanced controls like resetting a printer to default values and altering cut controls.
As part of this I identified a couple of other bugs with the bounding box calculations that have been fixed.