Skip to content

Commit

Permalink
not using non breaking spaces for text spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymovin committed Apr 5, 2020
1 parent e6ea3f1 commit c569246
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions player/js/utils/text/TextProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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){
Expand Down Expand Up @@ -386,7 +384,7 @@ TextProperty.prototype.completeTextData = function(documentData) {
for(i=0;i<len;i+=1){
letterData = letters[i];
letterData.anIndexes[j] = ind;
if((based == 1 && letterData.val !== '') || (based == 2 && letterData.val !== '' && letterData.val !== '\u00A0') || (based == 3 && (letterData.n || letterData.val == '\u00A0' || i == len - 1)) || (based == 4 && (letterData.n || i == len - 1))){
if((based == 1 && letterData.val !== '') || (based == 2 && letterData.val !== '' && letterData.val !== ' ') || (based == 3 && (letterData.n || letterData.val == ' ' || i == len - 1)) || (based == 4 && (letterData.n || i == len - 1))){
if(animatorData.s.rn === 1){
indexes.push(ind);
}
Expand Down

0 comments on commit c569246

Please sign in to comment.