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

Text bounds not supporting font weight #241

Closed
JoachimM7 opened this issue Dec 6, 2017 · 4 comments
Closed

Text bounds not supporting font weight #241

JoachimM7 opened this issue Dec 6, 2017 · 4 comments
Assignees
Milestone

Comments

@JoachimM7
Copy link
Contributor

The bounds()-function in the Text.swift only returns the size of the normal weighted font. So for bold fonts for example the bounds are wrong. Line no. 95 should be changed to:

font = MFont.systemFont(ofSize: CGFloat(f.size), weight: getWeight(f.weight))

As well you have to copy the getWeight-function, but I would suggest to return MFont.Weight.regular as default.

@ystrot ystrot self-assigned this Dec 7, 2017
@ystrot ystrot added this to the 0.9.2 milestone Dec 7, 2017
@ystrot
Copy link
Member

ystrot commented Dec 7, 2017

Thanks for reporting! Your proposal looks good. Did you think about creating a pull request to keep your authorship for all your work?

@JoachimM7
Copy link
Contributor Author

I'll try, but I have to admit, that I still don't understand, how I can do that on Github. But I will look for it ;)

@zapletnev
Copy link
Contributor

Hi @Lupurus

To make a PR you should do next:

  1. Make a fork of exyte/Macaw repository
  2. Make a new branch for specific task in your fork (for example, text_bounds_fix)
  3. Make required changes + commit it
  4. Go back to exyte/Macaw and make a new PR from your local branch to exyte/Macaw master branch.

Good luck!

@JoachimM7
Copy link
Contributor Author

Thank you!! I tried that, I hope I did it right :)

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

No branches or pull requests

3 participants