1.0.0 • Published 4 years ago

@rezanehzati/texttoimg v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

textToImg

Convert text with font specification to image format

See Demo

npm.io

How to use 

var optionsParameter = {
      width: 700,
      height: 220,
      paddingX: 20,
      paddingY: 100,
      canvasTargetDomId: "canvasTargetDom",
      font: ["50px", "Homemade Apple"],
      color: "black",
      textString: 'reza nehzati',
      customFont: {
        name: "Homemade Apple",
        url:
          "https://fonts.gstatic.com/s/homemadeapple/v10/Qw3EZQFXECDrI2q789EKQZJob0x6XH0.ttf"
      }
    };
    let textSignature =  new TextSignature(optionsParameter);

HTML target element

<div id="canvasTargetDom" />