How to use the konva.TextPath function in konva

To help you get started, we’ve selected a few konva examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github runbytech / ultron-ele / src / sections / certificateSection.js View on Github external
drawAllText(textLayer, courseName, achievement, dateObj) {
    textLayer.destroyChildren()// clear first

    const textpath = new Konva.TextPath({
      x: 0,
      y: 0,
      fill: '#7D9EC0',
      fontSize: 14,
      fontFamily: 'Arial',
      text: 'ULTRONELE',
      data: 'M280 40 C 290 22, 340 22, 360 40'
    })
    const userName = this.state.userFullName
    const userTxt = new Konva.Text({
      x: 280, y: 196,
      fontFamily: 'Bitter Bold',
      fontSize: 24,
      fontStyle: 'bold',
      text: userName,
      fill: 'black',
github runbytech / ultron-ele / src / sections / certificateSection.js View on Github external
fontFamily: 'Bitter Bold',
      fontSize: 14,
      text: dateStr,
      fill: '#333',
    })
    // const courseName = 'Business Essence'
    const courseTxt = new Konva.Text({
      x: 320, y: 264,
      fontFamily: 'Bitter Bold',
      fontSize: courseName.length>40?16:22,
      text: courseName?courseName:'NO COURSE COMPLETED',
      fill: 'black',
    })
    courseTxt.offsetX(courseTxt.width() / 2)
    
    const achievemTxt = new Konva.TextPath({
      x: 10, y: 306,
      fill: '#EEE',
      fontSize: 14,
      fontStyle: 'bold',
      fontFamily: 'Arial',
      text: achievement,
      // text: 'qualified',
      data: 'M288 44 C 284 72, 342 72, 340 30'
    })

    const qore = new Konva.Text({
      x: 310, y: 324,
      fontFamily: 'Bitter Bold',
      fontSize: 30,
      text: achievement?achievement[0]:'-',
      fill: 'white',

konva

<p align="center"> <img src="https://konvajs.org/android-chrome-192x192.png" alt="Konva logo" height="180" /> </p>

MIT
Latest version published 1 month ago

Package Health Score

88 / 100
Full package analysis