Closed edweij closed 4 years ago
Thank you for this pull request.
There are a few things I'd like to discuss:
Hi @huysentruitw, thank you for your good comments.
I'll update to use system fonts instead and remove the embedded font. I did't like the extra barcode types introduced to let the renderer know if content should be rendered but I couldn't come up with a better idea? Specifying a font name has the same problem. Maybe there is a more elegant way to just send this to the renderer, even if it is only relevant to EAN barcodes? Suggestions?
I can use your idea with a white rect to make room for the text and remove the duplicate code.
I'd add two arguments to the ImageRenderer
and to a new constructor for the SvgRenderer
:
bool includeEanContentAsText = false
string eanFontFamily = null
Later, I can choose to obsolete those constructor in favor for ones with an options object instead.
By doing the change this way, we do not need to touch the barcode core code.
Ok, that sounds good.
I have replaced the embedded font with string eanFontFamily. I have removed the extra barcode types and added the constructor parameters you suggested.
I still need to look at the render methods. I let you know when it's ready.,
I think the code is updated as you wanted now .
With the new parameter includeEanContentAsText in the new constructor for SvgRenderer the methods are no longer static. Is this as you suggested?
Thank you for this implementation. 🎉
I will merge it to the develop branch as I want to make some changes to the code-layout before releasing to master.
Possibility to choose if string content also should be rendered on EAN8 and EAN13 barcodes.