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 doesn't render anymore #2

Open
matprec opened this issue Aug 12, 2016 · 4 comments
Open

Text doesn't render anymore #2

matprec opened this issue Aug 12, 2016 · 4 comments

Comments

@matprec
Copy link

matprec commented Aug 12, 2016

Wr-sample doesn't render text anymore on current Wr.

Changes made can be seen in this commit.

Summary:
Delete Cargo.lock, Update src to fit trait requirements, compile on current nightly, reactivate text rendering - run and miss the text on the screen.
Os: Win 10
GPU: NVidia Gtx750ti
Driver: NVIDIA 364.72

@matprec
Copy link
Author

matprec commented Aug 14, 2016

It's probably related to the Wr2 changes, the last commit which i got to compile on my machine and worked was this one.
The oldest non working which compiled is the one fixing the border fragment shader.

I'm going to dissect this problem further, but it seems to be a Wr related issue, so i'll post this in Wr.

@glennw
Copy link
Owner

glennw commented Aug 19, 2016

What was the eventual issue? Should this be closed now?

@matprec
Copy link
Author

matprec commented Aug 19, 2016

The TextBoundaries are invalid.
If you give draw a glyph at (100,100), the corresponding bitmap lower left corner will be drawn at (100,100) (simplified, wr does take baseline into account). Therefore the bitmap upper right corner will be at the upper right, let's say (150,50).

But the boundaries start at (100,200) and has a size of (700,300). It simply doesn't contain the to be rendered glyph and i assume that Wr2 finally takes the bounds into account. Quick sketch:

Window:
$ Represents the to be rendered glyph, # the text boundaries
|==========|
| $        |
|          |
| #######  |
| #     #  |
| #######  |

I can make a PR for the fix (one number) if you'd like. But i would update the example to use the most current webrender as well.

@valpackett
Copy link

capture

The text works on 0.7.0 master (a3adb113f)! Discovered this while working on running Webrender on FreeBSD.

(However, if you just uncommented the text lines, the sample would crash FreeBSD out of the box, because the font path is /usr/local/share/fonts/dejavu/DejaVuSansMono.ttf here :D I think you should just commit a small font to the repo.)

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