Figma Inside — .fig file analysis

> This article is about analyzing Figma files using a library called kiwi, written by Figma’s former CTO evan wallace.
> Currently, Figma does not officially use this library.
> > But it was very helpful in understanding the structure of Figma files.
>
> The various functions and logic that are covered were analyzed and reconstructed from the source at https://madebyevan.com/figma/fig-file-parser/.> 这篇文章是关于使用名为 kiwi 的库分析 Figma 文件的,该库由 Figma 前 CTO evan wallace 编写。
> 目前,Figma 并未正式使用此库。
> > 但它在理解 Figma 文件结构方面非常有帮助。
>
> 所涵盖的各种函数和逻辑是从源代码 https://madebyevan.com/figma/fig-file-parser/ 中分析并重构的。
Are.fig files a mystery?
Are.fig files a mystery?
Have you ever opened a.fig file? Most likely, the answer is no.
你打开过 .fig 文件吗?很可能,答案是否定的。
Unlike traditional design tools, Figma has adopted a cloud-based, simultaneous editing system that has completely changed the concept of “saving a design file” as we’re used to it.
与传统设计工具不同,Figma 采用了一种基于云的、同时编辑系统,这完全改变了我们习以为常的“保存设计文件”的概念。
As a result,.fig files are unlike anything we’ve ever known. Since we can no longer have the concept of saving files as original data, how do we manage our data?
因此,.fig 文件与我们以往所知的一切都不同。由于我们不能再有将文件作为原始数据保存的概念,我们如何管理我们的数据?
There are many places that still require a backup file as a storage concept, and you can’t use it as a backup at all.
有许多地方仍然要求将备份文件作为存储概念,但你根本无法将其用作备份。
And there’s another problem: we can’t open the file because the format of the.fig is not publicly available. If we import the.fig, it will be completely different data because it will be in a new figma file.
还有另一个问题:我们无法打开文件,因为 .fig 的格式并非公开可用。如果我们导入 .fig,它将是完全不同的数据,因为它将位于一个新的 figma 文件中。
So why can’t we open this file directly, and what information is in it?
那么为什么我们不能直接打开这个文件,它里面有什么信息?
File Structure in Figma
Figma 中的文件结构
Figma files are stored in binary form, so we can’t open them directly. However, understanding the structure of Figma files can help us understand Figma better.
Figma 文件以二进制形式存储,所以我们无法直接打开它们。然而,了解 Figma 文件的结构可以帮助我们更好地理解 Figma。
Let’s analyze the file one by one in the order belo...