• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adobe XD - Plugin - JavaScript - UXP - StyleRanges question

Explorer ,
Feb 27, 2023 Feb 27, 2023

Copy link to clipboard

Copied

So, im trying to understand the styleRanges a bit more.
Im not sure if i quite understand correctly
https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#Text-styleRanges 


Visually, within Adobe XD, i can see that all the same styles are applied continously within the text's field.
However, when i console.log styleRanges, I am getting mutiple 'ranges' or multiple indexes within the array.  In my mind, this should not be happening since every character has the same styling. The length of the array should be one and that one index should contain only one object of styling since every character shares the same style.  
Why is it that i am getting more than one?


I even checked each property and they all match.


Below are two objects within the array

StyleRanges: []
Object One:

  1. charSpacing: -50
  2. fill: {value: 4290710426}
  3. fontFamily: "Arial"
  4. fontSize: 36
  5. fontStyle: ""
  6. hyperlinkUrl: ""
  7. length: 8
  8. linkId: ""
  9. strikethrough: false
  10. textScript: "none"
  11. textTransform: "none"
  12. underline: false
  13. [[Prototype]]: Object

    ObjectTwo:
  1. charSpacing: -50
  2. fill: {value: 4290710426}
  3. fontFamily: "Arial"
  4. fontSize: 36
  5. fontStyle: ""
  6. hyperlinkUrl: ""
  7. length: 8
  8. linkId: ""
  9. strikethrough: false
  10. textScript: "none"
  11. textTransform: "none"
  12. underline: false
  13. [[Prototype]]: Object
TOPICS
Plug-ins

Views

111

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation