Code Monkey home page Code Monkey logo

Comments (4)

DatzMe101 avatar DatzMe101 commented on July 17, 2024

In addition to the concern of mine, how can I set the font size relative to the size of the image. Coz for now I manually set the font size. Is there any way that the size of font become relative to the width of the picture?

from watermarkjs.

brianium avatar brianium commented on July 17, 2024

Take a look at http://brianium.github.io/watermarkjs/text.html - this has an example of rotating text under the "Rotate" heading. That particular function is pretty naive and works for that picture, but it shouldn't be too hard to cook up a function that works across all pictures.

As for relative font-size, that would be something that needs to be implemented. Every watermarking function receives the the target canvas as an argument. This canvas has dimension properties that you could use to figure out an ideal font size :)

Take a look at the built-in styles if you want an idea how to get started writing some of these functions. If you come up with something useful, I would be happy to accept a pull request.

from watermarkjs.

DatzMe101 avatar DatzMe101 commented on July 17, 2024

That was a great response Sir. Im thankful that you respond. Anyway thank you for the rotation matter. And for the font size i just made an alternative by getting the actual width of the picture and divide it to how many characters of my text and thanks it work. Ill let you know if i have some question and thank you for this plugin that save my day :)

from watermarkjs.

brianium avatar brianium commented on July 17, 2024

I'm glad it was useful to you :)

from watermarkjs.

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.