Skip to content

Commit

Permalink
Merge pull request #12 from iodigital-com/gradle-plugin-2
Browse files Browse the repository at this point in the history
Add font_style
  • Loading branch information
crysxd authored Nov 7, 2024
2 parents d91380f + cba315f commit bacab7f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ internal fun FigmaNode.asFigExTextStyle(): FigExValue<FigExTextStyle> = with(doc
?: base.fontSize,
fontWeight = boundValuesByMode["fontWeight"]?.get(mode)?.asInt()
?: base.fontWeight,
fontStyle = boundValuesByMode["fontStyle"]?.get(mode)?.asString()
?: base.fontStyle,
fontFamily = boundValuesByMode["fontFamily"]?.get(mode)?.asString()
?: base.fontFamily,
fontPostScriptName = boundValuesByMode["fontPostScriptName"]?.get(mode)?.asString()
?: base.fontPostScriptName,
letterSpacing = boundValuesByMode["letterSpacing"]?.get(mode)?.asFloat()
?: base.letterSpacing,
lineHeightPercent = boundValuesByMode["lineHeightPercent"]?.get(mode)?.asFloat()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data class FigExTextStyle(
val fontPostScriptName: String = "serif",
val fontSize: Float = 14f,
val fontWeight: Int = 500,
val fontStyle: String = "Regular",
val letterSpacing: Float = 0f,
val lineHeightPercent: Float = 104f,
val lineHeightPercentFontSize: Float = 127f,
Expand All @@ -20,6 +21,7 @@ data class FigExTextStyle(
"font_family" to fontFamily,
"font_post_script_name" to fontPostScriptName,
"font_size" to fontSize,
"font_style" to fontStyle,
"font_weight" to fontWeight,
"letter_spacing" to letterSpacing,
"line_height_percent" to lineHeightPercent,
Expand Down
38 changes: 19 additions & 19 deletions gradle-plugin/src/functionalTest/expected_full_dump.json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
"section_eyebrow": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Heavy",
"font_size": 32.0,
"font_style": "Regular",
"font_weight": 800,
"letter_spacing": 0.0,
"line_height_percent": 104.166664,
Expand All @@ -198,8 +198,8 @@
"section_title": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Bold",
"font_size": 72.0,
"font_style": "Regular",
"font_weight": 700,
"letter_spacing": 0.0,
"line_height_percent": 83.33333,
Expand All @@ -213,8 +213,8 @@
"section_description": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Medium",
"font_size": 24.0,
"font_style": "Regular",
"font_weight": 500,
"letter_spacing": 0.0,
"line_height_percent": 111.11111,
Expand All @@ -228,8 +228,8 @@
"main_heading": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Bold",
"font_size": 32.0,
"font_style": "Regular",
"font_weight": 700,
"letter_spacing": 0.0,
"line_height_percent": 104.166664,
Expand All @@ -243,8 +243,8 @@
"main_body": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Regular",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 400,
"letter_spacing": 0.0,
"line_height_percent": 125.0,
Expand All @@ -258,8 +258,8 @@
"_glyph": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 20.0,
"font_style": "Regular",
"font_weight": 400,
"letter_spacing": -0.120000005,
"line_height_percent": 102.4,
Expand All @@ -273,8 +273,8 @@
"_text": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 15.0,
"font_style": "Regular",
"font_weight": 500,
"letter_spacing": -0.09,
"line_height_percent": 136.53333,
Expand All @@ -288,8 +288,8 @@
"_text_small_": {
"base": {
"font_family": "Inter",
"font_post_script_name": "Inter-SemiBold",
"font_size": 12.0,
"font_style": "Regular",
"font_weight": 600,
"letter_spacing": -0.072000004,
"line_height_percent": 113.77778,
Expand All @@ -303,8 +303,8 @@
"main_subheading": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Regular",
"font_size": 24.0,
"font_style": "Regular",
"font_weight": 400,
"letter_spacing": 0.0,
"line_height_percent": 111.11111,
Expand All @@ -318,8 +318,8 @@
"examples_main_strong": {
"base": {
"font_family": "Inter",
"font_post_script_name": "Inter-Bold",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 700,
"letter_spacing": 0.0,
"line_height_percent": 123.943665,
Expand All @@ -333,8 +333,8 @@
"main_body_strong": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Bold",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 700,
"letter_spacing": 0.0,
"line_height_percent": 125.0,
Expand All @@ -348,8 +348,8 @@
"copy": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Regular",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 400,
"letter_spacing": 0.0,
"line_height_percent": 128.0,
Expand All @@ -363,8 +363,8 @@
"examples_small": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 14.0,
"font_style": "Regular",
"font_weight": 500,
"letter_spacing": 0.0,
"line_height_percent": 141.6499,
Expand All @@ -378,8 +378,8 @@
"pos_ui_11": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 11.0,
"font_style": "Regular",
"font_weight": 400,
"letter_spacing": 0.055,
"line_height_percent": 124.121216,
Expand All @@ -393,8 +393,8 @@
"neg_ui_11_medium": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 11.0,
"font_style": "Regular",
"font_weight": 500,
"letter_spacing": 0.11,
"line_height_percent": 124.121216,
Expand All @@ -408,8 +408,8 @@
"main_subheading_strong": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-Bold",
"font_size": 24.0,
"font_style": "Regular",
"font_weight": 700,
"letter_spacing": 0.0,
"line_height_percent": 111.11111,
Expand All @@ -423,8 +423,8 @@
"main_body_italic": {
"base": {
"font_family": "Whyte",
"font_post_script_name": "Whyte-BookItalic",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 350,
"letter_spacing": 0.0,
"line_height_percent": 125.0,
Expand All @@ -438,8 +438,8 @@
"examples_main": {
"base": {
"font_family": "Inter",
"font_post_script_name": "serif",
"font_size": 16.0,
"font_style": "Regular",
"font_weight": 500,
"letter_spacing": 0.0,
"line_height_percent": 123.943665,
Expand All @@ -453,8 +453,8 @@
"examples_heading": {
"base": {
"font_family": "Inter",
"font_post_script_name": "Inter-ExtraBold",
"font_size": 32.0,
"font_style": "Regular",
"font_weight": 800,
"letter_spacing": 0.0,
"line_height_percent": 103.286385,
Expand Down
2 changes: 1 addition & 1 deletion samples/full_dump.json.figex
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
{%- for mode in style.modes %}
"{{ mode.name.snake }}": {
"font_family": "{{ mode.font_family }}",
"font_post_script_name": "{{ mode.font_post_script_name }}",
"font_size": {{ mode.font_size }},
"font_style": "{{ mode.font_style }}",
"font_weight": {{ mode.font_weight }},
"letter_spacing": {{ mode.letter_spacing }},
"line_height_percent": {{ mode.line_height_percent }},
Expand Down

0 comments on commit bacab7f

Please sign in to comment.