Skip to main content
Inspiring
May 18, 2023

P: Unable to get TextItem.font when contents are empty

  • May 18, 2023
  • 1 reply
  • 281 views

Version of the app:
24.3.0

Platform and OS version:
Windows/MacOS

 

Basic steps to reproduce the problem:

  1. Create a text layer with some contents
  2. Apply a font that is not MyriadPro-Regular
  3. Delete the text contents
  4. Add text contents back in with javascript (optional)
  5. Access the font property of the TextItem object with javascript
  6. Add text contents manually through the UI
  7. Access the font property of the TextItem object with javascript again

 

Expected result:

Step 5 should return the font applied in step 2, matching the one shown in the UI.

 

Actual result:

Step 5 returns the default font MyriadPro-Regular, conflicting with the correct font shown in the UI.

Step 7 returns the correct font applied in step 2.

 

Notes:

Using ScriptListener to record step 6 shows that over 500 lines of code are generated with various item-specific values, so this makes it prohibitive to work around the issue with that method just to reliably access the correct font.

This topic has been closed for replies.

1 reply

CShubert
Community Manager
Community Manager
May 22, 2023

The team will look into this.