Skip to main content
Question

Bug: REST API styleOverrideTable fails to represent default value overrides


Emery_De_Nuccio

There is an issue with the styleOverrideTable when the override is a default text style value, it does not express the override back to the default value.

For example, if the entire text node is underlined, but one character is overridden to not be underlined, the expected behavior of the styleOverrideTable would be that character has {textCase: “ORIGINAL”} but instead we get back an empty object {}.

Here is an example that illustrates the problem:

Figma – 19 Jun 24

And the JSON we get from the REST API:

"characters": "FAQs",
"style": {
  "fontFamily": "Rubik",
  "fontPostScriptName": "Rubik-Medium",
  "fontWeight": 500,
  "textCase": "UPPER",
  "textAutoResize": "WIDTH_AND_HEIGHT",
  "textDecoration": "UNDERLINE",
  "fontSize": 12,
  "textAlignHorizontal": "RIGHT",
  "textAlignVertical": "TOP",
  "letterSpacing": 0.24,
  "lineHeightPx": 14.219999313354492,
  "lineHeightPercent": 100,
  "lineHeightUnit": "INTRINSIC_%"
},
"layoutVersion": 0,
"characterStyleOverrides": [
  2,
  78,
  79,
  3
],
"styleOverrideTable": {
  "2": {
    "textDecoration": "UNDERLINE"
  },
  "3": {
    "textDecoration": "UNDERLINE"
  },
  "78": {
    "fontFamily": "Rubik",
    "fontPostScriptName": "RubikRoman-ExtraBold",
    "fontWeight": 813
  },
  "79": {}
},

There is no possible way to know that the “Q” is not underlined with this response. “79”: {} should be “79”: {textCase: “ORIGINAL”} to unset the base “UNDERLINE”.

Note that this issue is seen with all character overrides to any default value, not just underline.

This topic has been closed for replies.

2 replies

Emery_De_Nuccio

Apologies, I mistyped. textDecoration: “NONE” is what is expected. But it also is seen with textCase: “ORIGINAL”. All default values from the specification have this problem.


Emery_De_Nuccio

Any ETA on a fix for this? Figma team are you reading these forum bug reports? Is there another venue that can be used to report these easily reproducible overt bugs?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings