RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
726 stars 114 forks source link

Support exporting typography for Android #82

Closed simonlee2 closed 3 years ago

simonlee2 commented 3 years ago

Description

Export typography styles into an XML file for Android. Each of the text styles is exported into the following format:

<style name="body">
  <item name="android:fontFamily">@font/ptsans_regular</item>
  <item name="android:textSize">16.0sp</item>
</style>
subdan commented 3 years ago

Wow! Thanks! I will check it out by the end of the week.

Do you plan to add support for custom line height? Example:

<item name="lineHeight">20sp</item>
<item name="android:minHeight">20sp</item>
simonlee2 commented 3 years ago

Wow! Thanks! I will check it out by the end of the week.

Do you plan to add support for custom line height? Example:

<item name="lineHeight">20sp</item>
<item name="android:minHeight">20sp</item>

Thanks for the quick response. figma-export has been helpful for our design system pipeline 🎉

We don't have plans on adding that soon as our team plans to set the line height separately for now.

subdan commented 3 years ago

Change name of the font files.

Font files placed at main/res/font must contain only lowercase a-z, 0-9, or underscore.

image
subdan commented 3 years ago

Update AndroidExample project by adding a new tab “Typography” with four TextView

simonlee2 commented 3 years ago