Skip to content

Commit

Permalink
not a good hyphenation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nclslbrn committed May 31, 2024
1 parent 26ce468 commit 176ee71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
6 changes: 3 additions & 3 deletions src/writer/blockWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 176ee71

Please sign in to comment.