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

crash when trying to use "terminus" font #494

Closed
ghost opened this issue Oct 20, 2019 · 3 comments
Closed

crash when trying to use "terminus" font #494

ghost opened this issue Oct 20, 2019 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 20, 2019

SolveSpace version: from git, 5d78f99

Operating system: Debian Buster

Expected behavior

Showing some text rendered with Terminus or display an error because of failure.

Actual behavior

Crash. Here is the log:

Generate::ALL took 184 ms
Missing (absent) translation for 'click to place bottom right of text'
Generate::DIRTY took 40 ms
Generate::DIRTY took 40 ms
freetype: cannot set character size: invalid pixel size
File /home/foobar/contrib/solvespace/src/solvespace/src/ttf.cpp, line 404, function AspectRatio:
Assertion failed: fontFace != NULL.
Message: Expected font face to be loaded.
zsh: abort      solvespace

The message about "cannot set character size" is thrown by ttf.cpp:234, content of sizeRequest is:
{type = FT_SIZE_REQUEST_TYPE_REAL_DIM, width = 65536, height = 65536, horiResolution = 128, vertResolution = 128}

Error value is not used or sent to caller on ttf.cpp:102, should be checked and probably return NULL. With other things, I guess.

@whitequark whitequark added the bug label Oct 20, 2019
@whitequark
Copy link
Contributor

Would you like to take a stab writing a PR?

@ghost
Copy link
Author

ghost commented Oct 20, 2019

I don't know what should be the solvespace behavior, I only did my best to make it easier to people with real understanding of it's codebase to fix that. If I knew enough the code, I'd probably try to implement support for psf format (fixed size, used in linux terminals, should be way faster to render since no real curves).

@whitequark
Copy link
Contributor

Fixed in 14e095c.

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

1 participant