1. Vinicius Stenzel
  2. PowerBuilder
  3. Thursday, 26 May 2022 01:32 AM UTC

I am trying to create datawindow labels with EAN-13 barcode using OpenType fonts as Libre Barcode EAN13 Text from google, but for some reason this kind of font demands enable special feature such as on MSWord "Fonts / Advanced / Contextual Alternates" (attached image for reference)

Somebody has idea as enable it on powerbuilder (2019R3)?

I tried others fonts but all have same OpenType Font behavior, demanding enable this feature for works well.

Thanks

Attachments (1)
John Fauss Accepted Answer Pending Moderation
  1. Friday, 27 May 2022 01:53 AM UTC
  2. PowerBuilder
  3. # 1

Hi, Vinicius - 

I figured out a pretty simple way to produce an EAN13 barcode as a DataWindow computed field using a specific EAN13 TrueType font and an Excel formula I learned about on (what else?) YouTube:

   https://www.youtube.com/watch?v=5fIJftPqE7k

* Update * - The Excel spreadsheet contains an error, so I've corrected the PB sample app and replaced the attached zip file.

After downloading the example Excel spreadsheet used in the video and the required TrueType font, both from the YouTube author's Google Drive (links are available in the author's comments and I've also included a text file with these URL's), I decoded the Excel formula and created a PB global function that does the needed encoding/translation of the barcode digits into the proper code points within the font.

From this, I've thrown together a very small, simple PB app that produces EAN13 barcodes:

The app, the TrueType font, and a text file containing the URL's to the resources I used are included in the attached zip file.

* Update * - The global encoding function now calculates the checksum digit (the 13th digit).

Note: The picture in your original post shows a ">" sign after the barcode image, which does not follow the EAN13 standards, as near as I can tell. I mention this because the app I've provided cannot produce a barcode that contains this extra character. The barcode you see above uses the "Code EAN13 Regular" TrueType font, size 72 points. While you can vary the size of the barcode by changing the point size, you cannot stretch the barcode to make it taller within a given width, for instance. It is what it is.

* Update * - I've included in the DataWindow the transformed barcode text produced by the global function.

I hope you find this possible solution to your issue helpful.

Best regards, John

Attachments (1)
Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Thursday, 26 May 2022 13:57 PM UTC
  2. PowerBuilder
  3. # 2

Unless there is a win32 api font setting, i'm not sure if there is much that can be done to set Contextual Alternates on.

this might help - basically reformat the values to Unicode character-code - although this seems like a lot of work.

 

EAN 13 | Libre Barcode Project (graphicore.github.io)

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 26 May 2022 01:53 AM UTC
  2. PowerBuilder
  3. # 3

Hi Vinicius;

   You might need to use a 3rd party tool for EAN-13 barcode support, for example:

https://www.componentsource.com/product/barcode-xpress-professional-2d-write

Regards .. Chris

Comment
  1. Vinicius Stenzel
  2. Thursday, 26 May 2022 17:23 PM UTC
Hi Chris,



Thanks, But I am looking for a free solution for now.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.