diff --git a/assets/bios/wp.js b/assets/bios/wp.js index c0126e6..551d6f2 100644 --- a/assets/bios/wp.js +++ b/assets/bios/wp.js @@ -187,6 +187,10 @@ function typesetLessRagged(lineStart, lineEnd) { return [printbuf, lineIndices] } +function getRealLength(text) { + return text.replaceAll(SYM_TWOSPC, ' ').replaceAll(SYM_LF, '').replaceAll(SYM_FF, '').length +} + function typesetJustified(lineStart, lineEnd) { function wordobj(t,v) { return {type:t, value:v} } function wordTypeOf(c, c1) { @@ -314,9 +318,6 @@ function typesetJustified(lineStart, lineEnd) { serial.println(`pn #${j} (${pns[j]})`) words[pns[j] + 1].value = SYM_TWOSPC; justLen += 1 } - - //justLen += (Math.min(spcToFill, pns.length) > 0) //wtf? why not increment every time you insert TWOSPC? - // TODO resolve issue of "type specimen \n ook." } spcToFill = paintWidth - justLen @@ -330,8 +331,6 @@ function typesetJustified(lineStart, lineEnd) { serial.println(`sp #${j}`) words[sps[j]].value = SYM_TWOSPC; justLen += 1 } - - //justLen += (Math.min(spcToFill, sps.length) > 0) //wtf? why not increment every time you insert TWOSPC? } } @@ -358,10 +357,9 @@ function typesetJustified(lineStart, lineEnd) { + textCursor += getRealLength(printbuf.last()) - textCursor += justLen - - if (printbuf.length > 4) break + if (printbuf.length > 5) break if (printbuf.length > paintHeight || textCursor >= text.length) break diff --git a/assets/wpfont.kra b/assets/wpfont.kra index d452f5a..2f2cac5 100644 --- a/assets/wpfont.kra +++ b/assets/wpfont.kra @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e95d7543eadcc4db6ab5dfbc68a066dd9bb92f4c5c21520433a7590cacb9f452 -size 115330 +oid sha256:7215a66afb4a6b8fb0de6bf7acba3f83d080fafe045853952c2311f27b552da2 +size 97321 diff --git a/assets/wpfont.png b/assets/wpfont.png index e99288a..7073e6e 100644 Binary files a/assets/wpfont.png and b/assets/wpfont.png differ