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

LoadFont with "bold" weight will crash #571

Closed
flierz opened this issue May 13, 2019 · 2 comments
Closed

LoadFont with "bold" weight will crash #571

flierz opened this issue May 13, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@flierz
Copy link

flierz commented May 13, 2019

I have an issue with getting my custom fonts to work in Macaw.

SVG file:
text id="A" font-family="Roboto-Bold, Roboto" font-size="30" font-weight="bold" line-spacing="40" fill="#FFFFFF"

It crashes in the following code for unexpectedly found nil while unwrapping an Optional value:
class func loadFont(name: String, size: Int, weight: String?) -> MFont? {
...
fontDesc = fontDesc.withSymbolicTraits(.traitBold)!
...
}

Hope you can fix it.
Thanks in advance.

@ystrot
Copy link
Member

ystrot commented May 13, 2019

Hey @flierz,

Couldn't reproduce your issue, but fixed possible crash. I think it might occurs because you have Roboto font, but don't have its bold version installed. Anyway, please use the master version to check it out.

@ystrot ystrot self-assigned this May 13, 2019
@flierz
Copy link
Author

flierz commented May 16, 2019

My issue was resolved by updating to the current master branch version, thanks a lot!

@flierz flierz closed this as completed May 16, 2019
@ystrot ystrot added this to the 0.9.6 milestone May 16, 2019
@ystrot ystrot added the bug label May 16, 2019
explaineverything pushed a commit to explaineverything/Macaw that referenced this issue May 23, 2019
* master:
  update w3c-test
  update w3c-test
  change location of SVGKeys
  Fix exyte#388: add enum Keys with fill, color and currentColor
  Fix exyte#388: add test for color-prop-05-t-manual
  Fix exyte#388: fix fill for group with currentColor
  Fix exyte#399: add test for struct-use-01-t-manual
  exyte#548 remove imageContextStack, add scale property to CGContext
  exyte#528 fix memory leak with Image objects
  Avoid NPE mentioned in exyte#571: LoadFont with "bold" weight will crash
@ystrot ystrot modified the milestones: 0.9.6, 0.9.7 Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants