Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Problems using external local fonts
Wed, Jul 13 2022 5:59 AMPermanent Link

Ralf Mimoun

Hi,

I need to show barcodes in my app - without external APIs. The easiest way is using a barcode font, eg. Code39. Works like a charm if you only need to encode some characters.

To do so, I downloaded the "Libre Barcode 39" font (https://fonts.google.com/specimen/Libre+Barcode+39 / https://google-webfonts-helper.herokuapp.com/fonts/libre-barcode-39?subsets=latin). I installed the ttf file on Windows, so I can see the barcode while developing. Then, I added three files (libre-barcode-39-v19-latin-regular.ttf, libre-barcode-39-v19-latin-regular.woff and libre-barcode-39-v19-latin-regular.woff2) as local external font files to the project. ASt last, I throw a label to the form, set a caption (eg. "12345") and the font to "Libre Barcode 39".

It works - if I run the project in the IDE. In Chrome on the same machine, I don't get the barcode font, but simply numbers. Same when I access if from a different machine, eg. my Android smartphone. Setting the font name to "Libre Barcode 39 Regular" (hey, it's worth a try!) does not help either.

Is there anything I do wrong?
Wed, Jul 13 2022 8:32 PMPermanent Link

erickengelke

Avatar

Ralf Mimoun wrote:
>I need to show barcodes in my app - without external APIs. The easiest way is using a barcode font,
> eg. Code39. Works like a charm if you only need to encode some characters.

I was thinking about this alternative solution:

https://lindell.me/JsBarcode/


JsBarcode works by creating a SVG image.

To use it, create an THTMLLabel, put
<svg class="barcode"
 jsbarcode-format="upc"
 jsbarcode-value="123456789012"
 jsbarcode-textmargin="0"
 jsbarcode-fontoptions="bold">
</svg>

into the Content.

Then load the library file

Then calls the external function as shown on the web page..

Someday I'll add this to the Nice library, but I'm backlogged this week and won't have a chance to do it in the next week or two.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Wed, Jul 13 2022 9:54 PMPermanent Link

erickengelke

Avatar

erickengelke wrote:

I've sent Ralf a prototype version for him to test.  When it's perfected I'll add it to my Nice library.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Thu, Jul 14 2022 4:17 AMPermanent Link

Ralf Mimoun

I found a solution: Don't use that font SmileSame with "Archon Code 39 Barcode", which is free for use too. But "Code39Azalea" works great. You can find them with google, all free to use in commercial application if I read the licenses correctly.
Thu, Jul 14 2022 4:45 AMPermanent Link

Ralf Mimoun

Oh, and I just tried Ericks prototype. It works like a charm and needs just a tad brushing over.
Thu, Jul 14 2022 6:16 PMPermanent Link

erickengelke

Avatar

Ralf Mimoun wrote:

>Oh, and I just tried Ericks prototype. It works like a charm and needs just a tad brushing over.

Great.  Email me any changes we need to make.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Image