Skip to content

opentype creates inset cuts #2

Open

Description

@rlarge

I know this is a long shot but would you know any reason opentype would create a string of text thats inset instead of the example of the outset.

Activity

  1. tmpvar commented on Mar 9, 2018

    @tmpvar
    Owner

    not off the top of my head, could you provide the font + command that you are running?

  2. rlarge commented on Mar 10, 2018

    @rlarge
    Author

    I was using your code exactly but a font called norwester. I then went and tried your font and found that its a negative space font. So it was working as expected by creating the gcode from the fill area. I was using the gcanvas example to create the same effect by putting a rectangle behind.

      roundRect(ctx, 0,0,180,60,5);
      ctx.fill('evenodd');
    
    function roundRect(ctx, x, y, w, h, r) {
      if (w < 2 * r) r = w / 2;
      if (h < 2 * r) r = h / 2;
      ctx.moveTo(x+r, y);
      ctx.arcTo(x+w, y,   x+w, y+h, r);
      ctx.arcTo(x+w, y+h, x,   y+h, r);
      ctx.arcTo(x,   y+h, x,   y,   r);
      ctx.arcTo(x,   y,   x+w, y,   r);
      ctx.closePath();
    }
    

    I can't seem to recreate it with your code any ideas.

  3. tmpvar commented on Mar 10, 2018

    @tmpvar
    Owner

    very interesting - I tried to repro what you are doing and downloaded https://www.fontsquirrel.com/fonts/norwester - is that the font you are using?

    I ran into an opentype.js error on 0.3.x and 0.8.x:

    text2gcode (master)‣ node text2gcode.js --font=/Users/tmpvar/Downloads/norwester/norwester.otf --diameter=6.35 --depth=-10 --pass=1
    /Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:331
        for (i = 0; i < s.length; i += 1) {
                         ^
    
    TypeError: Cannot read property 'length' of undefined
        at Font.stringToGlyphs (/Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:331:22)
        at Font.forEachGlyph (/Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:384:19)
        at Font.getPath (/Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:410:10)
        at /Users/tmpvar/work/js/text2gcode/text2gcode.js:62:19
        at /Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:950:16
        at /Users/tmpvar/work/js/text2gcode/node_modules/opentype.js/dist/opentype.js:797:9
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:504:3)
    
  4. rlarge commented on Mar 10, 2018

    @rlarge
    Author

    Ya i don't get any errors, i'm running newest version of opentype. That is the font i was using also. And it works as expected. I had to put in a feed to preview in the visualization but thats it.

    I can't only get inset code still playing around with it. any ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions