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

[messages] overlapping lines when using unicode #2057

Closed
idavydov opened this issue Jul 22, 2022 · 6 comments
Closed

[messages] overlapping lines when using unicode #2057

idavydov opened this issue Jul 22, 2022 · 6 comments
Labels
type-bug Something isn't working

Comments

@idavydov
Copy link
Contributor

Affected hardware version

Bangle 2

Your firmware version

2v14

The bug

Overlapping lines in notification from gadgetbridge

PXL_20220715_160414511

When I receive notification from signal (in groups) sometimes lines of unicode text are partially overlapping on the screen.

I suppose the reason is that the notification header contains: "Group name: Group member", which occupies two lines. And all the subsequent lines are then partially overlapping.

I was not able to reproduce it using gadgetbridge debug, since there you can only set a message, not the header.

I'm not sure if it's a bug in messages or in the gadgetbridge (bangle.js flavor).

@idavydov idavydov added the type-bug Something isn't working label Jul 22, 2022
@idavydov idavydov changed the title [app/widget name] Short description of bug [messages] overlapping lines when using unicode Jul 24, 2022
@gfwilliams
Copy link
Member

Thanks - this is a tricky one to fix. The unicode can't be displayed natively by Bangle.js so it's being converted to an image on the phone.

The Bangle thinks it has chosen a smaller font, but because the text is now and image the font size can't be changed and it overlaps.

If we just changed it so the background of the text wasn't cleared, would that fix it for you?

@idavydov
Copy link
Contributor Author

Thanks, I'm not sure I understand the whole complexity of the issue.

So what you are suggesting is basically, replace "white" with "transparent" in the fond and hope that characters will not overlap?

I suppose it's better than just overwriting with "white", but still characters will overlap in some cases.

A few questions since I do not know how gadgetbridge interacts with messages.

Is there a reason why messages doesn't know the line height?

Or maybe there is a possibility to:
a) set a smaller font in gadgetbridge by default, e.g., as an option? I could then set "always use minimal font" in gadgetbridge to avoid the isse
b) let gadgetbridge (roughly) deduce the desired font size based on the text length

@gfwilliams
Copy link
Member

replace "white" with "transparent" in the fond and hope that characters will not overlap?

Yes - it's an easy tweak that shouldn't really break anything.

Is there a reason why messages doesn't know the line height?

It works out the height based on the font - but since it's an image (inside the text) the height isn't related to the font.

I could then set "always use minimal font" in gadgetbridge to avoid the isse

Yes, we could have a font size option - that could be added pretty easily

let gadgetbridge (roughly) deduce the desired font size based on the text length

Yes, it's possible - but also very likely it'll get it wrong!

Another option is to allow Bangle.js to automatically halve the size of images in text if they are too big (or double them if they are too big). which could work well too

@gfwilliams
Copy link
Member

I've just implemented the size config (and transparent background) - and it should roll out to the google play store in the next day or so

gfwilliams added a commit to gfwilliams/Gadgetbridge that referenced this issue Jul 25, 2022
@idavydov
Copy link
Contributor Author

Thanks, @gfwilliams
I can confirm that we reduced font size + transparent background it looks much better!

@gfwilliams
Copy link
Member

Great! Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants