From cb2f2c3f64eaa02ac0b3c7253438c1184836e47b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 5 Apr 2024 21:21:37 -0500 Subject: [PATCH] fix: work in progress on encodings - https://github.com/foliojs/restructure/issues/60 - this is sufficient to allow fontkit's unit tests to pass with restructure 3.0.1 --- src/String.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/String.js b/src/String.js index dd4b264..38d6cce 100644 --- a/src/String.js +++ b/src/String.js @@ -95,9 +95,12 @@ function encodingWidth(encoding) { switch(encoding) { case 'ascii': case 'utf8': // utf8 is a byte-based encoding for zero-term string + case 'x-mac-roman': return 1; case 'utf16le': case 'utf16-le': + case 'utf-16be': + case 'utf-16le': case 'utf16be': case 'utf16-be': case 'ucs2':