Over the past month I’ve been on a little indie hacker journey, where I built my first freemium plugin for Figma: Screenshot to Layout.
Essentially it’s an OCR plugin: it recognizes text from screenshots and renders it back to Figma.
In my first version, I used a file input.
I felt I had a nice breakthrough when I realized I could run my plugin as a command, and have no user interface at all.
Over the past month I’ve contemplated various UI options but I always keep coming back to having no user interface at all. Except to enter the API key, upgrade your account, there are no UI options to be seen.
Right now I am close to launch, and looking for testers. Testers will get free usage of the plugin for their honest feedback. Register your interest here!
Hey all, my bootstrapping journey is reaching an exciting point where we are able to provide real value to designers with the Obra Figma plugins, starting with the Screenshot to Layout plugin.
To bring things over the finish line, I am looking for a Svelte developer with (some) design chops to develop and fine tune more of the user journey. Most of the work would be happening in August.
There are lots of details to be handled, and I am looking for a communicative developer who can execute work but at the same time bring their own thinking to make the end result better.
Skills I am looking for are:
JS/TS + Svelte + Sveltekit knowledge
Insight in Figma
Bonus if
You can develop Figma plugins
Extra pro
Supabase knowledge
The biggest part of the job would be Svelte and Sveltekit related.
If you are interested to work with me, reach out with your portfolio/resume/personal site, your hourly tariff or pricing logic, to jobs@obra.studio.
In the previous tutorial, we ended with 2 rectangles.
The second building block that’s good to learn about is rendering text to the canvas.
Working with text is its own challenge in Figma, because there are a lot of edge cases.
The first thing to understand is that a font needs to be loaded in order for text to be able to render. Fortunately, there is a font that we always know will be there, which is Inter, used by Figma for its UI itself.
So for the sake of the simplicity of this tutorial, let’s start using Inter to render text. Later we can move to a more difficult use case.
If you are starting out, you don’t need to have followed the previous tutorial to do this one. You can start this one from scratch.
We will once again use the Figlet plugin, which makes it so you don’t have to set up a development environment and you can start coding right away.
Getting started
If you don’t have one already, make a new Figlet account inside the Figlet plugin.
Now, create a new Figma design file, run Figlet, and click the new Figlet button (the + button)
Now you have some code to write! The second building block we will look at is creating text.
Notice how I also used the y part to set the y position of the 2nd text variable.
Let’s see what else we can do with text.
Let’s add a bit more text:
// Make sure the loadFonts from previous example exists
loadFonts().then(() => {
const text = figma.createText()
text.characters = 'Hello world'
text.fontSize = 16
text.fontName = { family: "Inter", style: "Medium" }
const text2 = figma.createText()
text2.characters = 'Hello world'
text2.fontSize = 16
text2.fontName = { family: "Inter", style: "Bold" }
text2.y += 20
const body = figma.createText()
body.characters = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
body.fontSize = 14
body.fontName = { family: "Inter", style: "Regular" }
body.y += 40
});
When you render this, you will see that is unseemingly wide – 2895 pixels to be exact.
Let’s make it a bit more manageable.
Add this code to the body variable and its subsequent manipulations:
body.resize(400,1)
body.textAutoResize = 'HEIGHT'
That looks a bit better.
Now, let’s try to create another style for links. This will involve working an “underline” text decoration, and a color fill.
Once again, place it outside of your loadFonts().then(() => { block.
Now we have a reusable setColor function to set colors, where we select the node as the first parameter and an array of RGB colours as the second parameter.
Let’s modify our existing code a little bit, to assume we are making a typographical system. Try doing the following:
Rename the first Hello world to Heading 1, and set the font size to
Rename the second Hello world to Heading 2, and set the font size to 24.
Swap the bold and medium on heading 1 and heading 2
Add “Body -” in front of the lorem ipsum of “body” to make people understand we’re talking about the body text there
Space out the typography examples by adjusting the “y” values.
Your complete text code would look a bit like this:
const text = figma.createText()
text.characters = 'Heading 1'
text.fontSize = 32
text.fontName = { family: "Inter", style: "Bold" }
const text2 = figma.createText()
text2.characters = 'Heading'
text2.fontSize = 24
text2.fontName = { family: "Inter", style: "Medium" }
text2.y += 42
const body = figma.createText()
body.characters = 'Body - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
body.fontSize = 14
body.fontName = { family: "Inter", style: "Regular" }
body.y += 76
body.resize(400,1)
body.textAutoResize = 'HEIGHT'
const link = figma.createText()
link.characters = 'My link'
link.fontSize = 14
link.fontName = { family: "Inter", style: "Regular" }
link.y += 220
link.textDecoration = "UNDERLINE"
setColor(link, [65,111,181])
And that code would render an example like this:
That’s where we will stop for now. The final code can be found here.
If you followed along with both tutorials, you now have a basic understanding of creating a shape, and how to render text in a Figma plugin.
I don’t know yet what the next tutorial will be about, but I want to find a logical next step to code, to get to a useful plugin. If you have any suggestions. place a comment below, it will motivate me to continue this series.
In this blog post series I would like to give an introduction to building Figma plugins.
We will be learning using a series of “building blocks” and then turn it into a real plugin in the end. In this first tutorial we will be looking at the most basic of basics: creating a rectangle.
We will make our start using the Figlet plugin, which makes it so you don’t have to set up a development environment and you can start coding right away.
Figlet is a new thing in the Figma plugins community. It’s comparable to Codepen or REPL-like environments in the sense that you can share Figlets, you can easily run them without setting up a dev environment, and you can easily have multiple figlets.
Getting started
Make a new Figlet account inside the Figlet plugin.
Now, create a new Figma design file, run Figlet, and click the new Figlet button.
Now you have some code to write! The first building block we will look at is creating a rectangle.
Enter and run the following code:
figma.createRectangle();
You will see a rectangle created on your artboard.
But where is it? If you can’t see it, try to find your new layer called Rectangle in the layer panel.
Zoom in to the rectangle (manually) and let’s continue.
Let’s give the rectangle a colour.
This is a good time to learn about nodes first.
Instead of directly running figma.createRectangle(), assign your rectangle to a variable, and log its contents.
const rect = figma.createRectangle()
console.log(rect)
Now, open the developer console using ⌥ + ⌘ + I (Mac) or Ctrl + Alt + I (Windows/Linux).
You will see the output of an object like this in the developer console.
What we are looking for to change the color is the fills object:
At this point, you might be tempted to just directly change the values using some code like:
const rect = figma.createRectangle()
const color = rect.fills[0].color
color.r = 0.5
color.g = 0.5
color.b = 0.5
This does not work!
You can’t directly manipulate certain objects, you have to clone them in their entirety, then manipulate them, and put back the cloned version.
The first thing I am building in my bootstrapping journey is a Figma plugin to turn a screenshot into an editable layout. You have a Figma plugin:
Imagine you take this screenshot:
And then when you process your image, you get this editable layout:
This way, as a designer, if somebody hands you something to improve, you have a starting point with the exact copy and you can have a starting point to continue from.
This is a situation that I encounter a lot, so I am kind of solving my own itch here. But I figure it will be useful for others.
If this, or my previous blog post sounds at all interesting and you’d like to discuss things – shoot me an e-mail: letsbootstrap@johanronsse.be .
I am starting something on the side, with the goal of bootstrapping a side business. The idea is to
build in public
build something that’s real (people can sign up, use it, it provides value)
see if ideas get traction (or not)
experiment and learn new things
In the past I’ve worked on small products like Kana Master and Keynote Extractor. It’s been a few years since I built and launched a product, and I feel energized to do it now.
What do I want to achieve? Chatting to another fellow indie hacker, the definition of “success” can vary wildly. Having a steady ARR that brings in some cash while having low maintenance can be interesting. For sure something could grow into something bigger. You can’t predict the future but you can get started building and learning and seeing which turns things will take, based on your actions.
One problem I always have is that I am not a backend developer. Over the past few years I’ve added more front-end knowledge to my skillset (e.g. React, Typescript, mostly out of necessity, and Svelte – out of interest). I can build out fully-fledged reactive user interfaces with a solid design, but when it comes to databases and to APIs I am pretty poor.
If any of this sounds at all interesting and you’d like to discuss it – shoot me an e-mail: letsbootstrap@johanronsse.be .
Joe Chesky, AirBnB CEO makes an observation on why designers never run companies in his sit-down with Figma CEO Dylan Field titled “Leading through uncertainty”:
“…I think because design, in some ways, is fragile. Companies are organized around a scientific method. And the creative process is something that requires nerve. And over the years, I started losing my nerve. I brought in a lot of people from a lot of different companies and they brought their way of working towards us. So what do we do? We basically divisionalize. We had like 10 different divisions, with 10 different subdivisions. We were very much ran by product managers. We had a plethora of A-B experiments. And the thing I started noticing is, the more people we added, the more projects we pursued, the less our app changed, and the more the cost went up. And I didn’t know what to do?”