Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support exporting typography for Android #82

Merged

Conversation

simonlee2
Copy link
Contributor

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>
  • post-script names are processed into @font/{lower_cased_post_script_name}
  • font size specifies sp to honor user's text preferences

@subdan
Copy link
Collaborator

subdan commented Mar 2, 2021

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
Copy link
Contributor Author

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.

Copy link
Collaborator

@subdan subdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add information about this new feature to the README.md
  • Update Examples/README.md by changing android screenshots.
  • Add font files to the res/font directory of AndroidExample project
  • Update AndroidExample project by adding a new tab “Typography” with four TextView

@subdan
Copy link
Collaborator

subdan commented Mar 19, 2021

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
Copy link
Collaborator

subdan commented Mar 19, 2021

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

@simonlee2
Copy link
Contributor Author

@simonlee2 simonlee2 requested a review from subdan March 22, 2021 09:42
@subdan subdan merged commit fc8a900 into RedMadRobot:master Mar 22, 2021
@simonlee2 simonlee2 deleted the feature/export_typography_android branch March 25, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants