From c569246b5edc88563984ff227ca61273a1b8cfc2 Mon Sep 17 00:00:00 2001 From: airnan Date: Sun, 5 Apr 2020 18:34:20 -0400 Subject: [PATCH] not using non breaking spaces for text spaces --- player/js/utils/text/TextProperty.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/player/js/utils/text/TextProperty.js b/player/js/utils/text/TextProperty.js index 44e93628d..01605f413 100644 --- a/player/js/utils/text/TextProperty.js +++ b/player/js/utils/text/TextProperty.js @@ -280,9 +280,7 @@ TextProperty.prototype.completeTextData = function(documentData) { newLineFlag = false; currentChar = documentData.finalText[i]; charCode = currentChar.charCodeAt(0); - if (currentChar === ' '){ - val = '\u00A0'; - } else if (charCode === 13 || charCode === 3) { + if (charCode === 13 || charCode === 3) { uncollapsedSpaces = 0; lineWidths.push(lineWidth); maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth; @@ -291,7 +289,7 @@ TextProperty.prototype.completeTextData = function(documentData) { newLineFlag = true; currentLine += 1; }else{ - val = documentData.finalText[i]; + val = currentChar; } if(fontManager.chars){ charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily); @@ -312,8 +310,8 @@ TextProperty.prototype.completeTextData = function(documentData) { letters.push({l:cLength,an:cLength,add:currentSize,n:newLineFlag, anIndexes:[], val: val, line: currentLine, animatorJustifyOffset: 0}); if(anchorGrouping == 2){ currentSize += cLength; - if(val === '' || val === '\u00A0' || i === len - 1){ - if(val === '' || val === '\u00A0'){ + if(val === '' || val === ' ' || i === len - 1){ + if(val === '' || val === ' '){ currentSize -= cLength; } while(currentPos<=i){ @@ -386,7 +384,7 @@ TextProperty.prototype.completeTextData = function(documentData) { for(i=0;i