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

improve code shape measurement and rendering #1425

Merged
merged 5 commits into from
Jun 20, 2023

Conversation

gavin-ts
Copy link
Contributor

Summary

Improve code shape text measurement and rendering.

Details

  • more accurately measure text
  • increase line height to 1.3
  • apply stroke-width for border on code shapes
  • adds new tests for leading/trailing newlines

dark theme code before

_Users_gavinnishizawa_github_repos_d2_d2renderers_d2svg_dark_theme_testdata_code_dark_theme exp svg

dark theme code after

_Users_gavinnishizawa_github_repos_d2_d2renderers_d2svg_dark_theme_testdata_code_dark_theme exp svg (1)

before

Screen Shot 2023-06-19 at 5 03 02 PM

after

Screen Shot 2023-06-19 at 5 02 45 PM

before

Screen Shot 2023-06-19 at 5 01 47 PM

after

Screen Shot 2023-06-19 at 5 02 07 PM

e2ereport

_Users_gavinnishizawa_github_repos_d2_e2etests_out_e2e_report html

@gavin-ts gavin-ts marked this pull request as ready for review June 20, 2023 02:45
@gavin-ts gavin-ts requested a review from a team June 20, 2023 02:45
Copy link
Collaborator

@alixander alixander left a comment

Choose a reason for hiding this comment

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

tests look good, nice

@gavin-ts gavin-ts merged commit c896922 into terrastruct:master Jun 20, 2023
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