SketchAPI icon indicating copy to clipboard operation
SketchAPI copied to clipboard

Incorrect font-style returned for text layers by javascript api

Open mayank10j opened this issue 5 years ago • 0 comments

While trying to get font-family and font-weight for an text layer, e.g. If I create a new text layer with font ass roboto with type thin. Copy CSS attributes from sketch UI returns this :

font-family: Roboto-Thin; font-size: 24px; color: #101010; letter-spacing: 0;

but JavaScript api on exporting text layer returns these font style properties:

opacity: 1 fontSize: 24 fontFamily: Roboto paragraphSpacing: 0 kerning: 0 fontWeight: 3 alignment: left fontStretch: condensed

Ideally roboto-thin should return font-weight as 100 See : https://fonts.google.com/specimen/Roboto Also sketch api should give font-family as either roboto-thin or fontFamily=Roboto with fontWeight:100 or fontWeight=1 Clearly Sketch JavaScript API is returning incorrect fontFamily and/or font-weight values.

Additional Information:

  • Sketch version: Version 65.1 (95501)
  • macOS version: 10.14.6 (18G4032)

mayank10j avatar May 20 '20 09:05 mayank10j