This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
George Papadakis
Posted Mar 11 - Read on Facebook

Is (optionally) importing Sketch text layers as html layers as opposed to image ones doable or planned?

Pros: no artifacts, programmatically modifiable text etc.

13 Comments

Jordan Robert Dobson

Text areas are fairly easy to make. What types of features would you want for one? I could probably create a basic one for you.

George Papadakis

I know. Still, what if you import those text layers from sketch as text layers having as style the one used in Sketch?

Perhaps I am not clear/specific enough.

Jordan Robert Dobson

Nope makes sense. But if you're going to modify them, why not just create them?

I just imagine it's a bit easier to export PNGs than all the text attributes, fonts, sizing, spacing, etc. It's doable but I bet you could make a tool that replaces a layer with a text layer pretty easily.

George Papadakis

Yes, a .replaceWith method is what I had in mind but you won't have the styles (color, font family, size) to apply to the layer you replaced the image one with.

Jordan Robert Dobson

Right. I assume you'd know them if you designed them. If you used them a lot just store the values in a variable and reuse as needed.

George Papadakis

Sure I could that. But old, busy people like me rarely have the time to do stuff the verbose way :)

Jordan Robert Dobson

Oh. I didn't realize you were old. My mistake. :|

Jordan Robert Dobson

36 here. ;)

George Papadakis

38ish and counting :)

Jordan Robert Dobson

If I have some time in the next week I'll give this a go. I tend to design in code so I'm always writing verbose text pieces and I would actually like to simplify so it's not such a pain to add in text programmatically.

George Papadakis

And here Jordan.

If you do make something, share it as a module. Could come in handy to the rest of us.

ps: maybe sketch text layer properties (such as style and content) are already stored in the imported struct somewhere. Or should be stored ;)

Cyrus Cheng

i have try , but i also can't found the way to change the value of text layer that import from sketch

Koen Bok

Everything is doable, but this is hard. CSS properties can only do a subset of what Sketch can do so you have to come up with some sensible mappings for edge cases.

Read the entire post on Facebook