Code Monkey home page Code Monkey logo

Comments (5)

fpirsch avatar fpirsch commented on May 19, 2024

Hello,
what do you mean by "requesting a glyph" ? What method are you using ?
font.charToGlyphIndex('I') (I as in uppercase i) returns 918. This font has a lot of different "I"s, and glyph 44 which is an I with serifs, feels strange in a sans-serif font.

from opentype.js.

quasado avatar quasado commented on May 19, 2024

hi,

thanks for getting back on this. I was ment to say that calling font.charToGlyph('I') on the given font returns the first glyph (the no-glyph rectangle) with a glyph index of zero.

from opentype.js.

fpirsch avatar fpirsch commented on May 19, 2024

It should work :
opensans

Do you get the same error with other characters, or with other fonts ?
Are you sure you are calling font.charToGlyph('I') from inside the opentype.load() callback ?

from opentype.js.

quasado avatar quasado commented on May 19, 2024

Hi,

Hmm this is really really weird. Yes, the call is done after the font is properly loaded. It works perfectly for all kind of glyphs except the uppercase I. Trying another font with the exact same code works as expected, so the code seems to be okay. I can really not explain myself what should be the case for this :(

Btw., we're using your great library in our free Design Tool Gravit (http://www.quasado.com/gravit) for custom text rendering allowing us to apply any kind of vector effects to text shapes :)

from opentype.js.

quasado avatar quasado commented on May 19, 2024

Ok, I am closing this. It seems that with the local version I do have it happens (I am using the latest one installed via bower). Doing the same with the online version works quite right.

from opentype.js.

Related Issues (20)

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.