Giter Site home page Giter Site logo

Comments (4)

Holger-Will avatar Holger-Will commented on September 17, 2024 2

probably yes. depends on the time i find on the weekend.

from code-128-encoder.

Holger-Will avatar Holger-Will commented on September 17, 2024 1

That is a common mistake on part of the font author. The reason for that is that there is a faulty encoder library which was widely used many many years ago, and as a consequence there are a lot of broken fonts and encoders out there.
As this encoder is explicitly standards compliant, i do not want to change its behaviour.
You do have some options though.

  1. use my code-128-font https://github.com/Holger-Will/code-128-font
  2. create your own font with the barcode-font-generator https://github.com/Holger-Will/barcode-font-generator
  3. or you can replace the correct codes with the wrong ones.

as for option 3: i might just implement some kind of quirks mode...

for now here is a patch function which should do the trick ;-)

function patch(x){
  var st=x
  st=st.replace(/È/g,"Ã")
  st=st.replace(/É/g,"Ä")
  st=st.replace(/Ê/g,"Å")
  st=st.replace(/Ë/g,"Æ")
  st=st.replace(/Ì/g,"Ç")
  st=st.replace(/Í/g,"È")
  st=st.replace(/Î/g,"É")
  st=st.replace(/Ï/g,"Ê")
  st=st.replace(/Ð/g,"Ë")
  st=st.replace(/Ñ/g,"Ì")
  st=st.replace(/Ò/g,"Í")
  st=st.replace(/Ó/g,"Î")
  return st
}

and then

patch(encoder.encode("Test"))

the resulting string should be compatible with the broken fonts you find on the net.

the bug for the broke google font is here: graphicore/librebarcode#9

from code-128-encoder.

igauravsehrawat avatar igauravsehrawat commented on September 17, 2024

Wow, thanks for such an elaborated reply.

from code-128-encoder.

igauravsehrawat avatar igauravsehrawat commented on September 17, 2024

Listening to conversation on librebarcode, are you going to change the barcode mappings on this repo now?

Thanks

from code-128-encoder.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.