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

Cropped characters in text_edit sample #215

Closed
dirkarnez opened this issue Aug 25, 2020 · 8 comments
Closed

Cropped characters in text_edit sample #215

dirkarnez opened this issue Aug 25, 2020 · 8 comments
Assignees

Comments

@dirkarnez
Copy link

image
image

The letter 'g' is cropped.

@djowel djowel self-assigned this Aug 26, 2020
@djowel djowel added the bug label Aug 26, 2020
@djowel
Copy link
Member

djowel commented Aug 26, 2020

Nice catch! Will look ASAP.

@djowel
Copy link
Member

djowel commented Aug 26, 2020

Odd. Again I can't repro in MacOS. Might be Windows thing again. I'll check later.
Screen Shot 2020-08-26 at 9 30 46 AM

@djowel
Copy link
Member

djowel commented Aug 26, 2020

Odd. Again I can't repro in MacOS. Might be Windows thing again. I'll check later.

Ah zooming and looking closely at my screenshot, its seems the "g" is also mildly cropped at the bottom.

@djowel
Copy link
Member

djowel commented Aug 26, 2020

OK, I'm not 100% sure, but it's looking like a cairo text-layout bug with the chinese font. Try changing the font to an english font like Roboto and notice that it's not cropped. Can you verify? Change this line:

char const* font_family = "文泉驿微米黑, \"WenQuanYi Micro Hei\"";

To this:

char const* font_family = "Roboto";

(Of course you have to remove the chinese text if you change the font.)

@dirkarnez
Copy link
Author

image

It really is the font issue

@djowel
Copy link
Member

djowel commented Aug 26, 2020

I'll close this for now, but I'll add an item in the TODO list: we need to create an MVCE and report to the cairo developers. I doubt there will be some action, but we'll see:

#216

@djowel djowel mentioned this issue Aug 26, 2020
15 tasks
@djowel djowel closed this as completed Aug 26, 2020
@djowel djowel added the wontfix label Aug 26, 2020
@dirkarnez
Copy link
Author

I'll close this for now, but I'll add an item in the TODO list: we need to create an MVCE and report to the cairo developers. I doubt there will be some action, but we'll see:

#216

Sounds like a cairo issue?

@faywong
Copy link
Contributor

faywong commented Aug 28, 2020

It's related to the different font & font metrics. I do a simple experiment:

1st: Roboto font + english char:
image

2nd: WenQuanYi font + english char:
image

3rd: WenQuanYi + Chinese char: same to 2nd case
image

Per this case, the conclusion is the english font is higher than chinese font. So when explicit chinese is specified(which decides the layout) & fallback english font is used, the english char is rended with crop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants