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

Generating JSON like ICOMOON #244

Open
rahaaatul opened this issue Oct 6, 2024 · 3 comments
Open

Generating JSON like ICOMOON #244

rahaaatul opened this issue Oct 6, 2024 · 3 comments

Comments

@rahaaatul
Copy link

rahaaatul commented Oct 6, 2024

Is it possible to generate JSON like icomoon does: icomoon-tabler.json?

I've tried to import .ttf & .json generated by svgtofont (here's the json) in KLWP but it's crashing the app, but it does not crash if it's generated by icomoon.

Here's my workflow file where I'm using svgtofont at line 127.

I'd really appreciate any help. Thank you.

@jaywcjlove
Copy link
Owner

image

@rahaaatul Did you set your directory incorrectly?

@rahaaatul
Copy link
Author

@rahaaatul Did you set your directory incorrectly?

Not actually. Those folders are from upstream. Temp is where I'm renaming and fixing the icons with svg-fixer. See line 98.

@rahaaatul
Copy link
Author

@jaywcjlove Is it possible to have this template:

{
  "icons": [
    {
      "icon": {
        "paths": [
          "M0 0h32v32H0z"  // Placeholder path for the blank glyph
        ],
        "attrs": [{}],
        "isMulticolor": false,
        "isMulticolor2": false,
        "grid": 0,
        "tags": ["blank"]  // Tag for the blank icon
      },
      "attrs": [{}],
      "properties": {
        "order": 1,
        "id": 0,           // Unique identifier for the blank glyph
        "name": "blank",   // Name for the blank glyph
        "prevSize": 32,
        "code": 0          // No Unicode, but index is 0
      },
      "setIdx": 0,
      "setId": 0,
      "iconIdx": 0
    },
    {
      "icon": {
        "paths": [
          "M512 256l3.456 0.128..." // SVG path for the second glyph
        ],
        "attrs": [{ "fill": "rgb(198, 192, 184)" }],
        "isMulticolor": false,
        "isMulticolor2": false,
        "grid": 0,
        "tags": ["icon-tag"] // Tag for the second glyph
      },
      "attrs": [{ "fill": "rgb(198, 192, 184)" }],
      "properties": {
        "order": 2,
        "id": 5466,                // Unique identifier for the second glyph
        "name": "icon-name",   // Name for the second glyph
        "prevSize": 32,
        "code": 60161               // EA01 in decimal is 60161
      },
      "setIdx": 0,
      "setId": 0,
      "iconIdx": 1                // Index for the second glyph
    }
  ]
}

instead of:

{
    "glyph": ["M512 256l3.456 0.128..."]
}

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

2 participants