diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index b9a72568..61fe6fe1 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 53.21%Statements 53.21%Branches 42.09%Branches 42.09%Lines 54.02%Lines 54.02%Functions 60.7%Functions 60.7% +Statements 53.33%Statements 53.33%Branches 42.22%Branches 42.22%Lines 54.14%Lines 54.14%Functions 60.71%Functions 60.71% diff --git a/badges/tests-badge.svg b/badges/tests-badge.svg index 054a703a..3c3fee34 100644 --- a/badges/tests-badge.svg +++ b/badges/tests-badge.svg @@ -1 +1 @@ -TestsTests153/153153/153 \ No newline at end of file +TestsTests158/158158/158 \ No newline at end of file diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index aef0794a..d27e6932 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -495,6 +495,8 @@ exports[`use various parts of svg-edit > check tool_star #0`] = ` text-decoration=" underline overline line-through" letter-spacing="150" word-spacing="10" + textLength="600" + lengthAdjust="spacingAndGlyphs" > B @@ -589,6 +591,8 @@ exports[`use various parts of svg-edit > check tool_polygon #0`] = ` text-decoration=" underline overline line-through" letter-spacing="150" word-spacing="10" + textLength="600" + lengthAdjust="spacingAndGlyphs" > B @@ -1183,3 +1187,212 @@ exports[`use various parts of svg-edit > check tool_word_spacing #0`] = ` `; + +exports[`use various parts of svg-edit > check tool_text_length #0`] = ` + + + Layer 1 + + + B + + + B + + + +`; + +exports[`use various parts of svg-edit > check tool_length_adjust_spacing #0`] = ` + + + Layer 1 + + + B + + + B + + + +`; + +exports[`use various parts of svg-edit > check tool_length_adjust_spacingAndGlyphs #0`] = ` + + + Layer 1 + + + B + + + B + + + +`; diff --git a/cypress/integration/ui/scenario.js b/cypress/integration/ui/scenario.js index f634450a..5a24344d 100644 --- a/cypress/integration/ui/scenario.js +++ b/cypress/integration/ui/scenario.js @@ -122,6 +122,26 @@ describe('use various parts of svg-edit', function () { .type('{enter}', {force: true}); testSnapshot(); }); + it('check tool_text_length', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#text_length') + .type('{selectall}', {force: true}) + .type('600', {force: true}) + .type('{enter}', {force: true}); + testSnapshot(); + }); + it('check tool_length_adjust_spacing', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#tool_length_adjust_spacing') + .click({force: true}); + testSnapshot(); + }); + it('check tool_length_adjust_spacingAndGlyphs', function () { + cy.get('#svg_1').click({force: true}); + cy.get('#tool_length_adjust_spacingAndGlyphs') + .click({force: true}); + testSnapshot(); + }); it('check tool_star', function () { cy.get('#tool_star') .click({force: true}); diff --git a/cypress/integration/unit/sanitize.js b/cypress/integration/unit/sanitize.js index 82726ee3..27e67dfb 100644 --- a/cypress/integration/unit/sanitize.js +++ b/cypress/integration/unit/sanitize.js @@ -56,4 +56,24 @@ describe('sanitize', function () { assert.equal(text.getAttribute('word-spacing'), '10'); }); + + it('Test sanitizeSvg() does not strip textLength attribute from text', function () { + const text = document.createElementNS(NS.SVG, 'text'); + text.setAttribute('textLength', '200'); + svg.append(text); + + sanitize.sanitizeSvg(text); + + assert.equal(text.getAttribute('textLength'), '200'); + }); + + it('Test sanitizeSvg() does not strip lengthAdjust attribute from text', function () { + const text = document.createElementNS(NS.SVG, 'text'); + text.setAttribute('lengthAdjust', 'spacingAndGlyphs'); + svg.append(text); + + sanitize.sanitizeSvg(text); + + assert.equal(text.getAttribute('lengthAdjust'), 'spacingAndGlyphs'); + }); }); diff --git a/src/editor/images/svg_edit_icons.svg b/src/editor/images/svg_edit_icons.svg index 82f68a7c..02efc40c 100644 --- a/src/editor/images/svg_edit_icons.svg +++ b/src/editor/images/svg_edit_icons.svg @@ -1111,6 +1111,28 @@ + + + + + + + + + + + + + + A + + + + + + + + diff --git a/src/editor/index.html b/src/editor/index.html index a6f4a341..2e59e457 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -381,6 +381,24 @@ +
+ + +
+ @@ -572,6 +590,10 @@
  • ab
  • ab
  • +
    diff --git a/src/editor/locale.js b/src/editor/locale.js index 14c050b8..9a4d6647 100644 --- a/src/editor/locale.js +++ b/src/editor/locale.js @@ -308,6 +308,8 @@ export const readLang = function (langData) { tool_italic: properties.italic, tool_letter_spacing: properties.letter_spacing, tool_word_spacing: properties.word_spacing, + tool_text_length: properties.text_length, + tool_length_adjust: properties.length_adjust, tool_line: tools.mode_line, tool_move_bottom: tools.move_bottom, diff --git a/src/editor/locale/lang.af.js b/src/editor/locale/lang.af.js index 83cd8929..4f195e12 100644 --- a/src/editor/locale/lang.af.js +++ b/src/editor/locale/lang.af.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ar.js b/src/editor/locale/lang.ar.js index 19cddf77..af26341d 100644 --- a/src/editor/locale/lang.ar.js +++ b/src/editor/locale/lang.ar.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.az.js b/src/editor/locale/lang.az.js index 42278cb2..9720f6b1 100644 --- a/src/editor/locale/lang.az.js +++ b/src/editor/locale/lang.az.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.be.js b/src/editor/locale/lang.be.js index 4e51fd86..6fab3c0b 100644 --- a/src/editor/locale/lang.be.js +++ b/src/editor/locale/lang.be.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.bg.js b/src/editor/locale/lang.bg.js index 493d435c..70fa6489 100644 --- a/src/editor/locale/lang.bg.js +++ b/src/editor/locale/lang.bg.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ca.js b/src/editor/locale/lang.ca.js index 22276f3c..87c39505 100644 --- a/src/editor/locale/lang.ca.js +++ b/src/editor/locale/lang.ca.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.cs.js b/src/editor/locale/lang.cs.js index 53c70753..d4552129 100644 --- a/src/editor/locale/lang.cs.js +++ b/src/editor/locale/lang.cs.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Hlavní menu', diff --git a/src/editor/locale/lang.cy.js b/src/editor/locale/lang.cy.js index 5f64fb72..e2e4d450 100644 --- a/src/editor/locale/lang.cy.js +++ b/src/editor/locale/lang.cy.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.da.js b/src/editor/locale/lang.da.js index ca05cb86..b6c3df79 100644 --- a/src/editor/locale/lang.da.js +++ b/src/editor/locale/lang.da.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.de.js b/src/editor/locale/lang.de.js index 51d0b9c0..05d1ae9b 100644 --- a/src/editor/locale/lang.de.js +++ b/src/editor/locale/lang.de.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Den Text zentriert ausrichten', text_anchor_end: 'Den Text rechtsbündig ausrichten', letter_spacing: 'Den Abstand zwischen den Buchstaben anpassen', - word_spacing: 'Den Abstand zwischen den einzelnen Wörtern anpassen' + word_spacing: 'Den Abstand zwischen den einzelnen Wörtern anpassen', + text_length: 'Die Breite, in dem der Text gezeichnet wird' }, tools: { main_menu: 'Hauptmenü', diff --git a/src/editor/locale/lang.el.js b/src/editor/locale/lang.el.js index 8b5da3b2..ee97833e 100644 --- a/src/editor/locale/lang.el.js +++ b/src/editor/locale/lang.el.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.en.js b/src/editor/locale/lang.en.js index 379fe097..43d4062a 100644 --- a/src/editor/locale/lang.en.js +++ b/src/editor/locale/lang.en.js @@ -76,6 +76,7 @@ export default { text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw', }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.es.js b/src/editor/locale/lang.es.js index ad3d81b4..04ff54d3 100644 --- a/src/editor/locale/lang.es.js +++ b/src/editor/locale/lang.es.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menú principal', diff --git a/src/editor/locale/lang.et.js b/src/editor/locale/lang.et.js index 3d97745c..1ceb195c 100644 --- a/src/editor/locale/lang.et.js +++ b/src/editor/locale/lang.et.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fa.js b/src/editor/locale/lang.fa.js index f19ca400..55b35a11 100644 --- a/src/editor/locale/lang.fa.js +++ b/src/editor/locale/lang.fa.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fi.js b/src/editor/locale/lang.fi.js index 3fbdb9c0..784c6aca 100644 --- a/src/editor/locale/lang.fi.js +++ b/src/editor/locale/lang.fi.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.fr.js b/src/editor/locale/lang.fr.js index 25d6c44f..449bf4c6 100644 --- a/src/editor/locale/lang.fr.js +++ b/src/editor/locale/lang.fr.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menu principal', diff --git a/src/editor/locale/lang.fy.js b/src/editor/locale/lang.fy.js index dc39a2ad..ddcb3809 100644 --- a/src/editor/locale/lang.fy.js +++ b/src/editor/locale/lang.fy.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ga.js b/src/editor/locale/lang.ga.js index cad4838a..7e2988fa 100644 --- a/src/editor/locale/lang.ga.js +++ b/src/editor/locale/lang.ga.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.gl.js b/src/editor/locale/lang.gl.js index 5288fb80..2895febd 100644 --- a/src/editor/locale/lang.gl.js +++ b/src/editor/locale/lang.gl.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.he.js b/src/editor/locale/lang.he.js index 65badcb2..80917a9d 100755 --- a/src/editor/locale/lang.he.js +++ b/src/editor/locale/lang.he.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hi.js b/src/editor/locale/lang.hi.js index 0db61dab..eecdac0d 100644 --- a/src/editor/locale/lang.hi.js +++ b/src/editor/locale/lang.hi.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hr.js b/src/editor/locale/lang.hr.js index fa1572ea..0994f385 100644 --- a/src/editor/locale/lang.hr.js +++ b/src/editor/locale/lang.hr.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hu.js b/src/editor/locale/lang.hu.js index 93165a2c..a68b58cd 100644 --- a/src/editor/locale/lang.hu.js +++ b/src/editor/locale/lang.hu.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.hy.js b/src/editor/locale/lang.hy.js index 3e7847bf..c17c9214 100644 --- a/src/editor/locale/lang.hy.js +++ b/src/editor/locale/lang.hy.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.id.js b/src/editor/locale/lang.id.js index dcca6a06..0b8ae33b 100644 --- a/src/editor/locale/lang.id.js +++ b/src/editor/locale/lang.id.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.is.js b/src/editor/locale/lang.is.js index a2713c9b..59c3b564 100644 --- a/src/editor/locale/lang.is.js +++ b/src/editor/locale/lang.is.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.it.js b/src/editor/locale/lang.it.js index 669ce4e9..cf4c6366 100644 --- a/src/editor/locale/lang.it.js +++ b/src/editor/locale/lang.it.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menù principale', diff --git a/src/editor/locale/lang.ja.js b/src/editor/locale/lang.ja.js index a58c18b8..97504d1e 100644 --- a/src/editor/locale/lang.ja.js +++ b/src/editor/locale/lang.ja.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ko.js b/src/editor/locale/lang.ko.js index a8b92d97..57558474 100644 --- a/src/editor/locale/lang.ko.js +++ b/src/editor/locale/lang.ko.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.lt.js b/src/editor/locale/lang.lt.js index d4b86522..49a4e895 100644 --- a/src/editor/locale/lang.lt.js +++ b/src/editor/locale/lang.lt.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.lv.js b/src/editor/locale/lang.lv.js index 539c9afd..0e46b569 100644 --- a/src/editor/locale/lang.lv.js +++ b/src/editor/locale/lang.lv.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.mk.js b/src/editor/locale/lang.mk.js index 719cd0c4..d97585e7 100644 --- a/src/editor/locale/lang.mk.js +++ b/src/editor/locale/lang.mk.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ms.js b/src/editor/locale/lang.ms.js index 5589df48..9729ea5d 100644 --- a/src/editor/locale/lang.ms.js +++ b/src/editor/locale/lang.ms.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.mt.js b/src/editor/locale/lang.mt.js index 80503c6a..55032211 100644 --- a/src/editor/locale/lang.mt.js +++ b/src/editor/locale/lang.mt.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.nl.js b/src/editor/locale/lang.nl.js index 8c661f98..71dd1141 100644 --- a/src/editor/locale/lang.nl.js +++ b/src/editor/locale/lang.nl.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Hoofdmenu', diff --git a/src/editor/locale/lang.no.js b/src/editor/locale/lang.no.js index f1be4342..d3ed7d1c 100644 --- a/src/editor/locale/lang.no.js +++ b/src/editor/locale/lang.no.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.pl.js b/src/editor/locale/lang.pl.js index e1f669a9..5c97860b 100644 --- a/src/editor/locale/lang.pl.js +++ b/src/editor/locale/lang.pl.js @@ -76,7 +76,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menu główne', diff --git a/src/editor/locale/lang.pt-BR.js b/src/editor/locale/lang.pt-BR.js index a1764f50..a3ec5420 100644 --- a/src/editor/locale/lang.pt-BR.js +++ b/src/editor/locale/lang.pt-BR.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menu Principal', diff --git a/src/editor/locale/lang.pt-PT.js b/src/editor/locale/lang.pt-PT.js index e035d719..03a21ea0 100644 --- a/src/editor/locale/lang.pt-PT.js +++ b/src/editor/locale/lang.pt-PT.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.ro.js b/src/editor/locale/lang.ro.js index aaf7b583..fb28f6c6 100644 --- a/src/editor/locale/lang.ro.js +++ b/src/editor/locale/lang.ro.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Menu Principal', diff --git a/src/editor/locale/lang.ru.js b/src/editor/locale/lang.ru.js index 8c947ce7..febd6e65 100644 --- a/src/editor/locale/lang.ru.js +++ b/src/editor/locale/lang.ru.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Главное меню', diff --git a/src/editor/locale/lang.sk.js b/src/editor/locale/lang.sk.js index 85be41c2..0de0e5e0 100644 --- a/src/editor/locale/lang.sk.js +++ b/src/editor/locale/lang.sk.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Hlavné menu', diff --git a/src/editor/locale/lang.sl.js b/src/editor/locale/lang.sl.js index c8b252f6..ac8eed49 100644 --- a/src/editor/locale/lang.sl.js +++ b/src/editor/locale/lang.sl.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Glavni meni', diff --git a/src/editor/locale/lang.sq.js b/src/editor/locale/lang.sq.js index e9f0424a..c9685980 100644 --- a/src/editor/locale/lang.sq.js +++ b/src/editor/locale/lang.sq.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sr.js b/src/editor/locale/lang.sr.js index 2ce3c079..1cf26695 100644 --- a/src/editor/locale/lang.sr.js +++ b/src/editor/locale/lang.sr.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sv.js b/src/editor/locale/lang.sv.js index 3bd6ed10..52a9fafb 100644 --- a/src/editor/locale/lang.sv.js +++ b/src/editor/locale/lang.sv.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.sw.js b/src/editor/locale/lang.sw.js index 6dd59b89..6c444d4d 100644 --- a/src/editor/locale/lang.sw.js +++ b/src/editor/locale/lang.sw.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.test.js b/src/editor/locale/lang.test.js index 44d16045..66127728 100644 --- a/src/editor/locale/lang.test.js +++ b/src/editor/locale/lang.test.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.th.js b/src/editor/locale/lang.th.js index 5d4ecb37..01fd4570 100644 --- a/src/editor/locale/lang.th.js +++ b/src/editor/locale/lang.th.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.tl.js b/src/editor/locale/lang.tl.js index c0aab0f3..c5649ae8 100644 --- a/src/editor/locale/lang.tl.js +++ b/src/editor/locale/lang.tl.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.tr.js b/src/editor/locale/lang.tr.js index 5d1bd168..74c5912a 100644 --- a/src/editor/locale/lang.tr.js +++ b/src/editor/locale/lang.tr.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.uk.js b/src/editor/locale/lang.uk.js index 08b092de..a65c80a4 100644 --- a/src/editor/locale/lang.uk.js +++ b/src/editor/locale/lang.uk.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.vi.js b/src/editor/locale/lang.vi.js index 81489396..0ee3c1a9 100644 --- a/src/editor/locale/lang.vi.js +++ b/src/editor/locale/lang.vi.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.yi.js b/src/editor/locale/lang.yi.js index cdee59a5..aa81ae02 100644 --- a/src/editor/locale/lang.yi.js +++ b/src/editor/locale/lang.yi.js @@ -76,6 +76,7 @@ export default { text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw', }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.zh-CN.js b/src/editor/locale/lang.zh-CN.js index 3b8208d5..eda4fb67 100644 --- a/src/editor/locale/lang.zh-CN.js +++ b/src/editor/locale/lang.zh-CN.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: '主菜单', diff --git a/src/editor/locale/lang.zh-HK.js b/src/editor/locale/lang.zh-HK.js index 4711eb16..c97a1d95 100644 --- a/src/editor/locale/lang.zh-HK.js +++ b/src/editor/locale/lang.zh-HK.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/locale/lang.zh-TW.js b/src/editor/locale/lang.zh-TW.js index c3242ab1..24214e5c 100644 --- a/src/editor/locale/lang.zh-TW.js +++ b/src/editor/locale/lang.zh-TW.js @@ -75,7 +75,8 @@ export default { text_anchor_middle: 'Align the text in middle', text_anchor_end: 'Align the text in end', letter_spacing: 'Change the letter spacing', - word_spacing: 'Change the word spacing' + word_spacing: 'Change the word spacing', + text_length: 'Lets you specify the width of the space into which the text will draw' }, tools: { main_menu: 'Main Menu', diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index e23a36d4..c11a4bc5 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -1205,6 +1205,7 @@ editor.init = () => { '#text_decoration_icon': 'textdecoration', '#letter_spacing_icon': 'letterspacing', '#word_spacing_icon': 'wordspacing', + '#text_length_icon': 'textlength', '.flyout_arrow_horiz': 'arrow_right', '.dropdown button, #main_button .dropdown': 'arrow_down', @@ -2335,6 +2336,9 @@ editor.init = () => { $('#word_spacing_slider').slider('option', 'value', wordSpacingValue); $('#font_family').val(elem.getAttribute('font-family')); $('#font_size').val(elem.getAttribute('font-size')); + const textLengthValue = svgCanvas.getTextLength(elem); + $('#text_length').val(textLengthValue); + $('#text_length_slider').slider('option', 'value', textLengthValue); $('#text').val(elem.textContent); if (svgCanvas.addedNew) { // Timeout needed for IE9 @@ -3934,6 +3938,12 @@ editor.init = () => { updateContextPanel(); }, {}); + addAltDropDown('#tool_length_adjust', '#length_adjust_opts', function () { + const selectedLengthAdjust = $(this).data('value'); + svgCanvas.setLengthAdjust(selectedLengthAdjust); + updateContextPanel(); + }, {}); + editor.addDropDown('#letter_spacing_dropdown', $.noop); $('#letter_spacing_slider').slider({ @@ -3984,6 +3994,32 @@ editor.init = () => { svgCanvas.setWordSpacing(val); }; + editor.addDropDown('#text_length_dropdown', $.noop); + + $('#text_length_slider').slider({ + step: 10, + max: 1000, + stop (evt, ui) { + changeTextLength(ui); + $('#text_length_dropdown li').show(); + $(window).mouseup(); + }, + slide (evt, ui) { + changeTextLength(ui, null); + } + }); + + const changeTextLength = function (ctl, val) { + if (Utils.isNullish(val)) { val = ctl.value; } + $('#text_length').val(val); + + if (!ctl || !ctl.handle) { + $('#text_length_slider').slider('option', 'value', val); + } + + svgCanvas.setTextLength(val); + }; + /* When a flyout icon is selected @@ -5870,6 +5906,9 @@ editor.init = () => { $('#word_spacing').SpinButton({ min: -1000, step: 1, stateObj, callback: changeWordSpacing }); + $('#text_length').SpinButton({ + min: -1000, max: 1000, step: 10, stateObj, callback: changeTextLength + }); $('#zoom').SpinButton({ min: 0.001, max: 10000, step: 50, stepfunc: stepZoom, stateObj, callback: changeZoom diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index 6ca9fa08..12fede7c 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -749,6 +749,70 @@ export const setWordSpacingMethod = function (value) { } }; +/** + * Returns the text length value + * @function module:svgcanvas.SvgCanvas#getTextLength + * @returns {string} The text length value + */ +export const getTextLengthMethod = function () { + const selectedElements = elemContext_.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { + return selected.getAttribute('textLength') || 0; + } + return null; +}; + +/** + * Set the new text length. + * @function module:svgcanvas.SvgCanvas#setTextLength + * @param {string} value - The text length + * @returns {void} + */ +export const setTextLengthMethod = function (value) { + const selectedElements = elemContext_.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && + isNullish(selectedElements[1])) { + elemContext_.getCanvas().changeSelectedAttribute('textLength', value); + } + if (!selectedElements[0].textContent) { + elemContext_.getCanvas().textActions.setCursor(); + } +}; + +/** + * Returns the length adjust value + * @function module:svgcanvas.SvgCanvas#getLengthAdjust + * @returns {string} The length adjust value + */ +export const getLengthAdjustMethod = function () { + const selectedElements = elemContext_.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && isNullish(selectedElements[1])) { + return selected.getAttribute('lengthAdjust') || 0; + } + return null; +}; + +/** + * Set the new length adjust. + * @function module:svgcanvas.SvgCanvas#setLengthAdjust + * @param {string} value - The length adjust + * @returns {void} + */ +export const setLengthAdjustMethod = function (value) { + const selectedElements = elemContext_.getSelectedElements(); + const selected = selectedElements[0]; + if (!isNullish(selected) && selected.tagName === 'text' && + isNullish(selectedElements[1])) { + elemContext_.getCanvas().changeSelectedAttribute('lengthAdjust', value); + } + if (!selectedElements[0].textContent) { + elemContext_.getCanvas().textActions.setCursor(); + } +}; + /** * @function module:svgcanvas.SvgCanvas#getFontFamily * @returns {string} The current font family diff --git a/src/svgcanvas/sanitize.js b/src/svgcanvas/sanitize.js index 3a4702ef..c29934e3 100644 --- a/src/svgcanvas/sanitize.js +++ b/src/svgcanvas/sanitize.js @@ -49,7 +49,7 @@ const svgWhiteList_ = { svg: ['class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'y'], switch: ['class', 'id', 'requiredFeatures', 'systemLanguage'], symbol: ['class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox'], - text: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-decoration', 'letter-spacing', 'word-spacing', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y', 'display'], + text: ['class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-decoration', 'letter-spacing', 'word-spacing', 'textLength', 'lengthAdjust', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y', 'display'], textPath: ['class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href', 'display'], title: [], tspan: ['class', 'clip-path', 'clip-rule', 'dx', 'dy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'rotate', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'textLength', 'transform', 'x', 'xml:space', 'y', 'display'], diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index 8848acbf..7945755a 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -58,7 +58,8 @@ import { setZoomMethod, setColorMethod, setGradientMethod, findDuplicateGradient, setPaintMethod, setStrokeWidthMethod, setStrokeAttrMethod, getBoldMethod, setBoldMethod, getItalicMethod, setItalicMethod, hasTextDecorationMethod, addTextDecorationMethod, removeTextDecorationMethod, setLetterSpacingMethod, - getLetterSpacingMethod, setWordSpacingMethod, getWordSpacingMethod, setTextAnchorMethod, + getLetterSpacingMethod, setWordSpacingMethod, getWordSpacingMethod, setTextLengthMethod, getTextLengthMethod, + setLengthAdjustMethod, getLengthAdjustMethod, setTextAnchorMethod, getFontFamilyMethod, setFontFamilyMethod, setFontColorMethod, getFontColorMethod, getFontSizeMethod, setFontSizeMethod, getTextMethod, setTextContentMethod, setImageURLMethod, setLinkURLMethod, setRectRadiusMethod, makeHyperlinkMethod, @@ -2273,6 +2274,38 @@ class SvgCanvas { */ this.setWordSpacing = setWordSpacingMethod; + /** + * Returns the text length. + * @function module:svgcanvas.SvgCanvas#getTextLength + * @param {string} value - The value that should be set + * @returns {string} The text length value + */ + this.getTextLength = getTextLengthMethod; + + /** + * Changes the text length. + * @function module:svgcanvas.SvgCanvas#setTextLength + * @param {string} value - The value that should be set + * @returns {void} + */ + this.setTextLength = setTextLengthMethod; + + /** + * Returns the length adjust. + * @function module:svgcanvas.SvgCanvas#getLengthAdjust + * @param {string} value - The value that should be set + * @returns {string} The length adjust value + */ + this.getLengthAdjust = getLengthAdjustMethod; + + /** + * Changes the length adjust. + * @function module:svgcanvas.SvgCanvas#setLengthAdjust + * @param {string} value - The value that should be set + * @returns {void} + */ + this.setLengthAdjust = setLengthAdjustMethod; + /** * Set the new text anchor. * @function module:svgcanvas.SvgCanvas#setTextAnchor