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

PR for :rise and :kerning in issue#520 #527

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

imlakshay08
Copy link
Contributor

@imlakshay08 imlakshay08 commented Jan 17, 2024

Description

for #520

This PR introduces support for the :rise and :kerning style within the text rendering functionalities of Scarpe.

For ":rise", it allows for the vertical adjustment of the font baseline, providing the ability to lift or plunge text elements based on the specified numeric value. This enhancement aligns Scarpe's text styling capabilities with the expected behavior specified for the :rise style in Shoes, offering increased control over the visual representation of text.

And for ":kerning", it enables the adjustment of letter spacing in text elements, allowing for precise control over the natural spacing between letters. By incorporating support for :kerning, Scarpe enhances its text styling capabilities, aligning with the specified behavior in Shoes. This feature provides flexibility in text formatting, ensuring a visually appealing representation.

Checklist

  • Run tests locally

@noahgibbs
Copy link
Collaborator

Letter-spacing looks like exactly the right CSS property, so well done there. You can get the HTML fixtures to be the same by providing a nil value when kerning is nil (it always is in the existing HTML examples) and then calling compact so that field goes away when unused.

It looks like baseline-shift may be deprecated in favour of vertical-align? https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/baseline-shift

@imlakshay08
Copy link
Contributor Author

Letter-spacing looks like exactly the right CSS property, so well done there. You can get the HTML fixtures to be the same by providing a nil value when kerning is nil (it always is in the existing HTML examples) and then calling compact so that field goes away when unused.

It looks like baseline-shift may be deprecated in favour of vertical-align? https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/baseline-shift

Alright. Let me modify it then.

replaced 'baseline-shift' with 'vertical-align'
@imlakshay08
Copy link
Contributor Author

Hey @noahgibbs , I updated it, all checks passed. Thank you for help.

@noahgibbs noahgibbs merged commit 2dd233f into scarpe-team:main Jan 17, 2024
1 check passed
@noahgibbs
Copy link
Collaborator

Awesome! Merged.

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