You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble importing styles with the font "open sans" from an exported json. All of the styles is in "open sans" from the beginning, but when I try to import them into a new sketch file some of the styles are now showing the font "helvetica". Some of the styles are showing correct fonts though(open sans). Any idea what is wrong?
Regards,
Mathias
The text was updated successfully, but these errors were encountered:
I was facing the same issue. I believe I have identified and solved the problem, finally.
Sketch doesn't seem to like the following values for the font key in the JSON export:
"OpenSans-Bold"
"OpenSans-Light"
"OpenSans-Italic"
"Inconsolata-Bold"
From what I can tell, Sketch was adding different fonts (and weights) intermittently as it wasn't able to read the aforementioned values. I was importing my list of text styles and they would all come in as "Helvetica", Regular.
I tweaked the values to reflect Mac OS's Font Book application's naming convention. I did a global find and replace in the JSON file:
"OpenSans" --> "Open Sans"
"OpenSans-Bold" --> "Open Sans Bold"
"OpenSans-Light" --> "Open Sans Light"
"OpenSans-Italic" --> "Open Sans Italic"
"Inconsolata-Bold" --> "Inconsolata Bold"
This solves the problem. It seems it is a matter of formatting the font value a little differently (no hyphens, appropriate use of spaces) in the JSON export @nilshoenson.
Interestingly, when doing some isolation testing with a colleague, it came to light that "Helvetica" is assigned to text styles that are using fonts that other people's systems do not already have installed, rather than Sketch's default behaviour where the text style essentially locked and provides the user with a warning.
I hope this helps, @mathande and anyone else who is facing this issue.
It's my second day using Text Styles. Such a great plugin!
I'm having trouble importing styles with the font "open sans" from an exported json. All of the styles is in "open sans" from the beginning, but when I try to import them into a new sketch file some of the styles are now showing the font "helvetica". Some of the styles are showing correct fonts though(open sans). Any idea what is wrong?
Regards,
Mathias
The text was updated successfully, but these errors were encountered: