Coder Social home page Coder Social logo

Comments (6)

kangax avatar kangax commented on May 21, 2024

Hey, sorry for the delayed response. If you guys have a minimal testcase, I'd love to take a look and see what's going on there.

from fabric.js.

kilaulena avatar kilaulena commented on May 21, 2024

Hey, thanks, but we're using http://code.google.com/p/canvas-text/ now for text rendering and fabric for the rest, not that pretty but it works.

from fabric.js.

pamelafox avatar pamelafox commented on May 21, 2024

I am trying out fabric.Text now as well, and am just trying to put it in the demo case.
I first included cufon.js (dL'ed from github), as otherwise it didn't know about it.

Then I added canvas.add(new fabric.Text('Hello')); to the demo.js, instead of a Rect, but am getting:

Uncaught TypeError: Object function () {
return api.replace.apply(null, arguments);
} has no method 'replaceElement'
_renderall.js:8053
renderall.js:8087
_draw

Do you know what's going on there? Thanks!

from fabric.js.

kangax avatar kangax commented on May 21, 2024

Sorry, my bad. I somehow missed Cufon from the dependencies. It's now under /lib and is included as part of a final build.

The reason text wasn't working is because there has to be a font file, describing how glyphs are to be rendered. I included some of the free fonts under /test/fonts — (http://github.com/kangax/fabric.js/tree/gh-pages/test/fonts); You can use Cufon builder to create them yourself (from .ttf, .otf, etc.) — http://cufon.shoqolate.com/generate/

I added a text object (rendered in "Delicious" font) to the demo page, as an example.

Hope this helps.

from fabric.js.

pamelafox avatar pamelafox commented on May 21, 2024

Thanks so much, great to have text be in the demo now.

from fabric.js.

saran110313 avatar saran110313 commented on May 21, 2024

fabric.util.loadImage( ' ../sample.png' , function(img){
});
Uncaught TypeError: object.render is not a function
fabric.StaticCanvas.fabric.util.createClass._onObjectAdded @ fabric.js:6378
fabric.Collection.add @ fabric.js:198
this image object move and not add the client side in image function.
how to solve this function...

from fabric.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.