diff --git a/demo/src/index.ts b/demo/src/index.ts index 48a584d..d995af5 100644 --- a/demo/src/index.ts +++ b/demo/src/index.ts @@ -11,7 +11,7 @@ const app = document.getElementById('app'), svg = document.createElementNS(namespace, 'svg'), settings = { Text: quotes[Math.floor(Math.random() * quotes.length)], - 'Letters per line': 60, + 'Letters per line': 30, 'Letter spacing': 1, 'Line spacing': 0.92, }, diff --git a/src/writer/blockWriter.ts b/src/writer/blockWriter.ts index 36c165d..5aff933 100644 --- a/src/writer/blockWriter.ts +++ b/src/writer/blockWriter.ts @@ -48,10 +48,10 @@ const charArray = (text: string, charsPerLine: number, hyphenFrom: number): Arra } // end line (create new line) else if ( - x + 7 > charsPerLine && + x + 4 > charsPerLine && j < letters.length - 1 && - !isConsonant(l) && - isConsonant(letters[j + 1]) + (!isConsonant(l) || + isConsonant(letters[j + 1])) ) { grid[y].push(...[l as Char, '-' as Char]); y++;