Skip to content

Commit

Permalink
Fixed character undercount
Browse files Browse the repository at this point in the history
Fixed problems in #3.
  • Loading branch information
Mileter committed Jun 28, 2024
1 parent bbb0b3b commit fc27143
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kern/kern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ void initnewline(istream & input, // any input stream works... cin, ifstream
string word;
if(!(input >> word)) // no more chars
break;
if(lineCharCount + word.size() > maxKerning) // to many words
{
if(lineCharCount + word.size() - 1 > maxKerning) // to many words
{ // ^ -1 to not account for the last space
output << endl;
lineCharCount = 0; // carridge return (restart to col 0)
lineCharCount = 0; // carridge return (restart to col 0)
}
output << word << " ";
lineCharCount += word.size();
lineCharCount += word.size() + 1; // account for words and spaces
}
}

Expand Down

0 comments on commit fc27143

Please sign in to comment.