dataliterate / data-populator

A plugin for Sketch and Adobe XD to populate your design mockups with meaningful data. Goodbye Lorem Ipsum. Hello JSON.
MIT License
1.67k stars 113 forks source link

Multiple text styles get overridden on replace #15

Closed rorysmyth closed 8 years ago

rorysmyth commented 9 years ago

screenshot

image

^ message if a different font weight from name

nitrada commented 9 years ago

@rorysmyth yeah, that's the case unfortunately and we haven't found a way around it. I fear it has to do with a limitation on the Sketch side and we cannot really solve it for the plugin.

Any comment on this from @lukas77me or @bomberstudios?

lukasondre commented 9 years ago

So far, I haven't found any way to extract the font/text style from a substring inside a text layer. It'd be great if @bomberstudios could point us in the right direction.

nitrada commented 9 years ago

@lukas77me maybe this could hint to a solution? https://medium.com/sketch-app-sources/sketch-plugin-snippets-for-plugin-developers-e9e1d2ab6827 (scroll down to "Working with Text Layers")?

lukasondre commented 9 years ago

The article points out a great way to set the style to a range so I'll see if I can get it to detect the initial style ranges too. Then it'll be possible to reapply the original style.

knowsnotmuch commented 9 years ago

Came to log this request as well - glad to see its already being deliberated. Thanks for the wonderful plugin anyway!

dantz commented 9 years ago

I'm new to the data populator and I tripped over this problem as well. Thanks for working on it.