scarpe-team / scarpe

Scarpe - shoes but running on webview
Other
162 stars 29 forks source link

Added and Fixed Para Styles #534

Closed Nj221102 closed 7 months ago

Nj221102 commented 7 months ago

Description

Added some more para styles like font-variant, font shorthand updated some para styles like font-family, emphasis

emphasis wasn't working before because it wasn't mentioned in shoes styles in lacci/lib/shoes/drawables/para.rb , so i made changes and now emphasis works font-family was mentioned as font in shoes styles so i changed it to family , because i wanted to use font for font shorthand(same as css) , and family also does sound better for font-family.

I have added a parse method to font -shorthand, so it doesn't matter in which pattern we enter properties as long as we maintain the gap of whitespace in between.

Shoes.app do

    para "this text is in normal styl" , emphasis:"italic"

    para "this text is in italic style" , font: "italic normal bold 16px 'Times New Roman', serif;"

    para "this text is in oblique style " , family: "'Pacifico', cursive;"

    para "Text in Helvetica", font: "Helvetica;"

    para "And in Lucida", font: "'Pacifico', cursive;"

    para "From an example", font: "Trebuchet  bold"

end
Shoes.app do

    para "This is Normal Variant" ,font_variant: "normal"

    para "This is Small Caps Variant " ,font_variant: "small-caps"

  end

Image(if needed, helps for a faster review)

Screenshot 2024-01-30 at 7 26 17 PM Screenshot 2024-01-31 at 11 44 05 PM

Checklist

noahgibbs commented 7 months ago

This looks good. It would benefit from tests -- that regex, for instance, is easily big enough to want testing. But this is a big improvement over where we are now, so I'm happy to merge it now and add tests later :-)

Nj221102 commented 7 months ago

This looks good. It would benefit from tests -- that regex, for instance, is easily big enough to want testing. But this is a big improvement over where we are now, so I'm happy to merge it now and add tests later :-)

Thanks for merging, if there is any problem with the code plz inform me, I will try my best to fix it