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

Import multicolor text characters #13

Open
ibrahimpenekli opened this issue Dec 13, 2022 · 1 comment
Open

Import multicolor text characters #13

ibrahimpenekli opened this issue Dec 13, 2022 · 1 comment
Labels
question Further information is requested ugui Built-in UI (uGUI)

Comments

@ibrahimpenekli
Copy link
Member

Figma returns colors for each characters in the text component if it has multiple color. So we can import them.

{
  "id": "86:14",
  "name": "Roboto Black Italic",
  "type": "TEXT",
  "scrollBehavior": "SCROLLS",
  "blendMode": "PASS_THROUGH",
  "absoluteBoundingBox": {
    "x": 563,
    "y": 464,
    "width": 140,
    "height": 28
  },
  "absoluteRenderBounds": {
    "x": 563.03515625,
    "y": 467.98828125,
    "width": 140.94140625,
    "height": 18.29296875
  },
  "constraints": {
    "vertical": "TOP",
    "horizontal": "LEFT"
  },
  "fills": [
    {
      "blendMode": "NORMAL",
      "type": "SOLID",
      "color": {
        "r": 0,
        "g": 0,
        "b": 0,
        "a": 1
      }
    }
  ],
  "strokes": [],
  "strokeWeight": 1,
  "strokeAlign": "OUTSIDE",
  "effects": [],
  "characters": "Roboto Black",
  "style": {
    "fontFamily": "Roboto",
    "fontPostScriptName": "Roboto-BlackItalic",
    "italic": true,
    "fontWeight": 900,
    "textAutoResize": "WIDTH_AND_HEIGHT",
    "fontSize": 24,
    "textAlignHorizontal": "LEFT",
    "textAlignVertical": "TOP",
    "letterSpacing": 0,
    "lineHeightPx": 28.125,
    "lineHeightPercent": 100,
    "lineHeightUnit": "INTRINSIC_%"
  },
  "layoutVersion": 3,
  "characterStyleOverrides": [
    68,
    68,
    68,
    68,
    68,
    68,
    68,
    40,
    40,
    40,
    40,
    40
  ],
  "styleOverrideTable": {
    "40": {
      "fills": [
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          }
        },
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 1,
            "g": 0,
            "b": 0,
            "a": 1
          }
        }
      ]
    },
    "68": {
      "fills": [
        {
          "blendMode": "NORMAL",
          "type": "SOLID",
          "color": {
            "r": 0,
            "g": 0.039999961853027344,
            "b": 1,
            "a": 1
          }
        }
      ]
    }
  },
  "lineTypes": [
    "NONE"
  ],
  "lineIndentations": [
    0
  ]
}
@ibrahimpenekli ibrahimpenekli added ugui Built-in UI (uGUI) question Further information is requested labels Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested ugui Built-in UI (uGUI)
Projects
None yet
Development

No branches or pull requests

1 participant