Giter Site home page Giter Site logo

figma-fig-tools's Introduction

fig parser

Hacky scripts to investigate the .fig file format.

Format

There are two formats of .fig file floating around. The older one has: 4 sections:

  • Header
  • kiwib schema (zlib deflated)
  • data (zlib deflated)
  • PNG thumbnail

Each section (except the header) consist of 2 fields:

  • 4 byte length (little endian)
  • data (length bytes)

The newer format is just a zip file containing:

  • canvas.fig - A fig file of the older format except without the trailing PNG thumbnail
  • thumbnail.png - The thumbnail that used to be embedded in the .fig
  • meta.json - A bunch of boring metadata
  • images/ - A folder that I've never seen populated but presumably contains... images

Installing

You'll need a relatively recent ruby (e.g. 2.7) and node + npm.

  • Firstly install npm packages with npm install.
  • Secondly, go grab a .fig file from figma
  • Thirdly, run ./figunpack <file>

The unpacked contents will be output to a directory called <file>.out/.

In addition to unpacking and inflating the file contents we convert the kiwi encoded data in to JSON and write this to data.json. If you're only interested in the figma data itself, this is the interesting bit.

figma-fig-tools's People

Contributors

mikesimons avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.