Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text exports one character per <text> element #2866

Open
liuweitao111 opened this issue Oct 25, 2022 · 2 comments
Open

Text exports one character per <text> element #2866

liuweitao111 opened this issue Oct 25, 2022 · 2 comments

Comments

@liuweitao111
Copy link

hi, If my text is in Arabic, there will be a problem with splitting the text into per characters.

For example:
My text is اختبر كتابتك العربية هههه
image

My expect results:
image

but current results is(in version 5.9.6):
image

Animation Data:

const data = {
  "v": "5.5.9",
  "fr": 24,
  "ip": 0,
  "op": 72,
  "w": 200,
  "h": 200,
  "nm": "合成 2",
  "ddd": 0,
  "assets": [
      {
          "id": "comp_0",
          "layers": [
              {
                  "ddd": 0,
                  "ind": 1,
                  "ty": 5,
                  "nm": "textnode",
                  "sr": 1,
                  "ks": {
                      "o": {
                          "a": 0,
                          "k": 100,
                          "ix": 11
                      },
                      "r": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": [
                                          0.833
                                      ],
                                      "y": [
                                          0.833
                                      ]
                                  },
                                  "o": {
                                      "x": [
                                          0.167
                                      ],
                                      "y": [
                                          0.167
                                      ]
                                  },
                                  "t": 0,
                                  "s": [
                                      0
                                  ]
                              },
                              {
                                  "i": {
                                      "x": [
                                          0.833
                                      ],
                                      "y": [
                                          0.833
                                      ]
                                  },
                                  "o": {
                                      "x": [
                                          0.167
                                      ],
                                      "y": [
                                          0.167
                                      ]
                                  },
                                  "t": 71,
                                  "s": [
                                      172.815
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      174
                                  ]
                              }
                          ],
                          "ix": 10
                      },
                      "p": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 0,
                                  "s": [
                                      35,
                                      40,
                                      0
                                  ],
                                  "to": [
                                      12.613,
                                      7.317,
                                      0
                                  ],
                                  "ti": [
                                      -31.075,
                                      -18.028,
                                      0
                                  ]
                              },
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 71,
                                  "s": [
                                      168.16,
                                      107.345,
                                      0
                                  ],
                                  "to": [
                                      22.717,
                                      13.18,
                                      0
                                  ],
                                  "ti": [
                                      -9.221,
                                      -5.349,
                                      0
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      166,
                                      116,
                                      0
                                  ]
                              }
                          ],
                          "ix": 2
                      },
                      "a": {
                          "a": 0,
                          "k": [
                              0,
                              0,
                              0
                          ],
                          "ix": 1
                      },
                      "s": {
                          "a": 0,
                          "k": [
                              100,
                              100,
                              100
                          ],
                          "ix": 6
                      }
                  },
                  "ao": 0,
                  "t": {
                      "d": {
                          "k": [
                              {
                                  "s": {
                                      "s": 12,
                                      "f": "STHeitiSC-Light",
                                      "t": "اختبر كتابتك العربية هههه",
                                      "j": 2,
                                      "tr": 0,
                                      "lh": 33.6,
                                      "ls": 0,
                                      "fc": [
                                          0.524,
                                          0.043,
                                          0.043
                                      ]
                                  },
                                  "t": 0
                              }
                          ]
                      },
                      "p": {},
                      "m": {
                          "g": 1,
                          "a": {
                              "a": 0,
                              "k": [
                                  0,
                                  0
                              ],
                              "ix": 2
                          }
                      },
                      "a": []
                  },
                  "ip": 0,
                  "op": 72,
                  "st": 0,
                  "bm": 0
              },
              {
                  "ddd": 0,
                  "ind": 2,
                  "ty": 4,
                  "nm": "rect",
                  "sr": 1,
                  "ks": {
                      "o": {
                          "a": 0,
                          "k": 100,
                          "ix": 11
                      },
                      "r": {
                          "a": 0,
                          "k": 0,
                          "ix": 10
                      },
                      "p": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 0,
                                  "s": [
                                      100,
                                      100,
                                      0
                                  ],
                                  "to": [
                                      22.5,
                                      -0.5,
                                      0
                                  ],
                                  "ti": [
                                      -22.5,
                                      0.5,
                                      0
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      235,
                                      97,
                                      0
                                  ]
                              }
                          ],
                          "ix": 2
                      },
                      "a": {
                          "a": 0,
                          "k": [
                              0,
                              0,
                              0
                          ],
                          "ix": 1
                      },
                      "s": {
                          "a": 0,
                          "k": [
                              100,
                              100,
                              100
                          ],
                          "ix": 6
                      }
                  },
                  "ao": 0,
                  "shapes": [
                      {
                          "ty": "gr",
                          "it": [
                              {
                                  "ty": "rc",
                                  "d": 1,
                                  "s": {
                                      "a": 0,
                                      "k": [
                                          67.559,
                                          65.285
                                      ],
                                      "ix": 2
                                  },
                                  "p": {
                                      "a": 0,
                                      "k": [
                                          0,
                                          0
                                      ],
                                      "ix": 3
                                  },
                                  "r": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 4
                                  },
                                  "nm": "矩形路径 1",
                                  "mn": "ADBE Vector Shape - Rect",
                                  "hd": false
                              },
                              {
                                  "ty": "st",
                                  "c": {
                                      "a": 0,
                                      "k": [
                                          1,
                                          1,
                                          1,
                                          1
                                      ],
                                      "ix": 3
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 4
                                  },
                                  "w": {
                                      "a": 0,
                                      "k": 2,
                                      "ix": 5
                                  },
                                  "lc": 1,
                                  "lj": 1,
                                  "ml": 4,
                                  "bm": 0,
                                  "nm": "描边 1",
                                  "mn": "ADBE Vector Graphic - Stroke",
                                  "hd": false
                              },
                              {
                                  "ty": "fl",
                                  "c": {
                                      "a": 0,
                                      "k": [
                                          0.949019607843,
                                          0.309803921569,
                                          0.949019607843,
                                          1
                                      ],
                                      "ix": 4
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 5
                                  },
                                  "r": 1,
                                  "bm": 0,
                                  "nm": "填充 1",
                                  "mn": "ADBE Vector Graphic - Fill",
                                  "hd": false
                              },
                              {
                                  "ty": "tr",
                                  "p": {
                                      "a": 0,
                                      "k": [
                                          -66.314,
                                          60.561
                                      ],
                                      "ix": 2
                                  },
                                  "a": {
                                      "a": 0,
                                      "k": [
                                          0,
                                          0
                                      ],
                                      "ix": 1
                                  },
                                  "s": {
                                      "a": 0,
                                      "k": [
                                          71.745,
                                          69.722
                                      ],
                                      "ix": 3
                                  },
                                  "r": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 6
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 7
                                  },
                                  "sk": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 4
                                  },
                                  "sa": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 5
                                  },
                                  "nm": "变换"
                              }
                          ],
                          "nm": "矩形 1",
                          "np": 3,
                          "cix": 2,
                          "bm": 0,
                          "ix": 1,
                          "mn": "ADBE Vector Group",
                          "hd": false
                      }
                  ],
                  "ip": 0,
                  "op": 72,
                  "st": 0,
                  "bm": 0
              }
          ]
      }
  ],
  "fonts": {
      "list": [
          {
              "origin": 0,
              "fPath": "",
              "fClass": "",
              "fFamily": "Heiti SC",
              "fWeight": "",
              "fStyle": "Light",
              "fName": "STHeitiSC-Light",
              "ascent": 73.5989987850189
          }
      ]
  },
  "layers": [
      {
          "ddd": 0,
          "ind": 1,
          "ty": 0,
          "nm": "comp1",
          "refId": "comp_0",
          "sr": 1,
          "ks": {
              "o": {
                  "a": 0,
                  "k": 100,
                  "ix": 11
              },
              "r": {
                  "a": 0,
                  "k": 0,
                  "ix": 10
              },
              "p": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      0
                  ],
                  "ix": 2
              },
              "a": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      0
                  ],
                  "ix": 1
              },
              "s": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      100
                  ],
                  "ix": 6
              }
          },
          "ao": 0,
          "w": 200,
          "h": 200,
          "ip": 0,
          "op": 72,
          "st": 0,
          "bm": 0
      }
  ],
  "markers": []
}
@RischinR
Copy link

RischinR commented Nov 3, 2022

@bodymovin there is now an option the get tspan off all letters like the player had in the previous version 5.8.1 (I think)
when using RTL language we need to workaround reversing letters and etc.

@dukeliberal
Copy link

hi, If my text is in Arabic, there will be a problem with splitting the text into per characters.

For example: My text is اختبر كتابتك العربية هههه image

My expect results: image

but current results is(in version 5.9.6): image

Animation Data:

const data = {
  "v": "5.5.9",
  "fr": 24,
  "ip": 0,
  "op": 72,
  "w": 200,
  "h": 200,
  "nm": "合成 2",
  "ddd": 0,
  "assets": [
      {
          "id": "comp_0",
          "layers": [
              {
                  "ddd": 0,
                  "ind": 1,
                  "ty": 5,
                  "nm": "textnode",
                  "sr": 1,
                  "ks": {
                      "o": {
                          "a": 0,
                          "k": 100,
                          "ix": 11
                      },
                      "r": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": [
                                          0.833
                                      ],
                                      "y": [
                                          0.833
                                      ]
                                  },
                                  "o": {
                                      "x": [
                                          0.167
                                      ],
                                      "y": [
                                          0.167
                                      ]
                                  },
                                  "t": 0,
                                  "s": [
                                      0
                                  ]
                              },
                              {
                                  "i": {
                                      "x": [
                                          0.833
                                      ],
                                      "y": [
                                          0.833
                                      ]
                                  },
                                  "o": {
                                      "x": [
                                          0.167
                                      ],
                                      "y": [
                                          0.167
                                      ]
                                  },
                                  "t": 71,
                                  "s": [
                                      172.815
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      174
                                  ]
                              }
                          ],
                          "ix": 10
                      },
                      "p": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 0,
                                  "s": [
                                      35,
                                      40,
                                      0
                                  ],
                                  "to": [
                                      12.613,
                                      7.317,
                                      0
                                  ],
                                  "ti": [
                                      -31.075,
                                      -18.028,
                                      0
                                  ]
                              },
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 71,
                                  "s": [
                                      168.16,
                                      107.345,
                                      0
                                  ],
                                  "to": [
                                      22.717,
                                      13.18,
                                      0
                                  ],
                                  "ti": [
                                      -9.221,
                                      -5.349,
                                      0
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      166,
                                      116,
                                      0
                                  ]
                              }
                          ],
                          "ix": 2
                      },
                      "a": {
                          "a": 0,
                          "k": [
                              0,
                              0,
                              0
                          ],
                          "ix": 1
                      },
                      "s": {
                          "a": 0,
                          "k": [
                              100,
                              100,
                              100
                          ],
                          "ix": 6
                      }
                  },
                  "ao": 0,
                  "t": {
                      "d": {
                          "k": [
                              {
                                  "s": {
                                      "s": 12,
                                      "f": "STHeitiSC-Light",
                                      "t": "اختبر كتابتك العربية هههه",
                                      "j": 2,
                                      "tr": 0,
                                      "lh": 33.6,
                                      "ls": 0,
                                      "fc": [
                                          0.524,
                                          0.043,
                                          0.043
                                      ]
                                  },
                                  "t": 0
                              }
                          ]
                      },
                      "p": {},
                      "m": {
                          "g": 1,
                          "a": {
                              "a": 0,
                              "k": [
                                  0,
                                  0
                              ],
                              "ix": 2
                          }
                      },
                      "a": []
                  },
                  "ip": 0,
                  "op": 72,
                  "st": 0,
                  "bm": 0
              },
              {
                  "ddd": 0,
                  "ind": 2,
                  "ty": 4,
                  "nm": "rect",
                  "sr": 1,
                  "ks": {
                      "o": {
                          "a": 0,
                          "k": 100,
                          "ix": 11
                      },
                      "r": {
                          "a": 0,
                          "k": 0,
                          "ix": 10
                      },
                      "p": {
                          "a": 1,
                          "k": [
                              {
                                  "i": {
                                      "x": 0.833,
                                      "y": 0.833
                                  },
                                  "o": {
                                      "x": 0.167,
                                      "y": 0.167
                                  },
                                  "t": 0,
                                  "s": [
                                      100,
                                      100,
                                      0
                                  ],
                                  "to": [
                                      22.5,
                                      -0.5,
                                      0
                                  ],
                                  "ti": [
                                      -22.5,
                                      0.5,
                                      0
                                  ]
                              },
                              {
                                  "t": 119,
                                  "s": [
                                      235,
                                      97,
                                      0
                                  ]
                              }
                          ],
                          "ix": 2
                      },
                      "a": {
                          "a": 0,
                          "k": [
                              0,
                              0,
                              0
                          ],
                          "ix": 1
                      },
                      "s": {
                          "a": 0,
                          "k": [
                              100,
                              100,
                              100
                          ],
                          "ix": 6
                      }
                  },
                  "ao": 0,
                  "shapes": [
                      {
                          "ty": "gr",
                          "it": [
                              {
                                  "ty": "rc",
                                  "d": 1,
                                  "s": {
                                      "a": 0,
                                      "k": [
                                          67.559,
                                          65.285
                                      ],
                                      "ix": 2
                                  },
                                  "p": {
                                      "a": 0,
                                      "k": [
                                          0,
                                          0
                                      ],
                                      "ix": 3
                                  },
                                  "r": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 4
                                  },
                                  "nm": "矩形路径 1",
                                  "mn": "ADBE Vector Shape - Rect",
                                  "hd": false
                              },
                              {
                                  "ty": "st",
                                  "c": {
                                      "a": 0,
                                      "k": [
                                          1,
                                          1,
                                          1,
                                          1
                                      ],
                                      "ix": 3
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 4
                                  },
                                  "w": {
                                      "a": 0,
                                      "k": 2,
                                      "ix": 5
                                  },
                                  "lc": 1,
                                  "lj": 1,
                                  "ml": 4,
                                  "bm": 0,
                                  "nm": "描边 1",
                                  "mn": "ADBE Vector Graphic - Stroke",
                                  "hd": false
                              },
                              {
                                  "ty": "fl",
                                  "c": {
                                      "a": 0,
                                      "k": [
                                          0.949019607843,
                                          0.309803921569,
                                          0.949019607843,
                                          1
                                      ],
                                      "ix": 4
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 5
                                  },
                                  "r": 1,
                                  "bm": 0,
                                  "nm": "填充 1",
                                  "mn": "ADBE Vector Graphic - Fill",
                                  "hd": false
                              },
                              {
                                  "ty": "tr",
                                  "p": {
                                      "a": 0,
                                      "k": [
                                          -66.314,
                                          60.561
                                      ],
                                      "ix": 2
                                  },
                                  "a": {
                                      "a": 0,
                                      "k": [
                                          0,
                                          0
                                      ],
                                      "ix": 1
                                  },
                                  "s": {
                                      "a": 0,
                                      "k": [
                                          71.745,
                                          69.722
                                      ],
                                      "ix": 3
                                  },
                                  "r": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 6
                                  },
                                  "o": {
                                      "a": 0,
                                      "k": 100,
                                      "ix": 7
                                  },
                                  "sk": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 4
                                  },
                                  "sa": {
                                      "a": 0,
                                      "k": 0,
                                      "ix": 5
                                  },
                                  "nm": "变换"
                              }
                          ],
                          "nm": "矩形 1",
                          "np": 3,
                          "cix": 2,
                          "bm": 0,
                          "ix": 1,
                          "mn": "ADBE Vector Group",
                          "hd": false
                      }
                  ],
                  "ip": 0,
                  "op": 72,
                  "st": 0,
                  "bm": 0
              }
          ]
      }
  ],
  "fonts": {
      "list": [
          {
              "origin": 0,
              "fPath": "",
              "fClass": "",
              "fFamily": "Heiti SC",
              "fWeight": "",
              "fStyle": "Light",
              "fName": "STHeitiSC-Light",
              "ascent": 73.5989987850189
          }
      ]
  },
  "layers": [
      {
          "ddd": 0,
          "ind": 1,
          "ty": 0,
          "nm": "comp1",
          "refId": "comp_0",
          "sr": 1,
          "ks": {
              "o": {
                  "a": 0,
                  "k": 100,
                  "ix": 11
              },
              "r": {
                  "a": 0,
                  "k": 0,
                  "ix": 10
              },
              "p": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      0
                  ],
                  "ix": 2
              },
              "a": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      0
                  ],
                  "ix": 1
              },
              "s": {
                  "a": 0,
                  "k": [
                      100,
                      100,
                      100
                  ],
                  "ix": 6
              }
          },
          "ao": 0,
          "w": 200,
          "h": 200,
          "ip": 0,
          "op": 72,
          "st": 0,
          "bm": 0
      }
  ],
  "markers": []
}

So did you have a workaround to fix this issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants