connectbot icon indicating copy to clipboard operation
connectbot copied to clipboard

Display/fonts broken after OnePlus 6 os update

Open jaggzh opened this issue 4 years ago • 19 comments

Bug description

OnePlus 6 update. OS now oxygen 11.1.1.1 Build a6000_22_210917

  • ConnectBot Version: 19.8 ? (From help)

The OS fonts, globally, seem a bit more crisp, the letters' lines thinner. Once in connectbot, on a host, the text spacing is off. It's as if a bounding box width calculation is not matching the actual text areas' rendered width. The cursor is far ahead of each char typed, for instance. Other areas of consecutive text (like, same color) seem bundled together, with gaps between (see screenshot)

Screenshot_20211027-004706

Steps to reproduce

  1. Hm. Not sure how without a OnePlus 6, or maybe it's Oxygen. I don't know if this is happening on any other devices. It does it, in the text from the hosts' display, on every host I connect to.

Expected behavior

Sequential letters should be sequential.

Server information

Linux debian testing, and an old raspberry pi on Raspbian.

jaggzh avatar Oct 27 '21 08:10 jaggzh

I see the same thing when a global font is selected on my Oneplus 8 Pro since the Update to Android 11.

WhatsApp message formatting is lost as well. Termux works fine.

eljoest avatar Oct 27 '21 09:10 eljoest

It looks like they broke font selection somehow. We are requesting a monospace font, but it's giving you a variable width font. I'm not sure what could be done from the app level here.

kruton avatar Oct 27 '21 18:10 kruton

I concur regarding the reason. It was already discussed in the Oneplus forum but there was no resolution and no fix. I believe Termux works around this by using a specific font (user selectable).

eljoest avatar Oct 27 '21 18:10 eljoest

Hi I confirm same issue with oneplus 6T. @eljoest would you mind share the forum post you mentioned for follow up?

bonjour81 avatar Nov 12 '21 23:11 bonjour81

So can we add the ability to select a specific font?

jaggzh avatar Dec 05 '21 16:12 jaggzh

(OnePlus should fix their stuff!) But maybe there was an API change to the [monosoace] font selection? I 'can't believe' they broke all such selection and haven't put out a fix yet.

jaggzh avatar Dec 05 '21 16:12 jaggzh

Hi, While I agree OP should fix their stuff, I think a selectable font would be a nice feature as well for connectbot (I think it's a feature some people wait too). Anyway, at the moment, connectbot is not really usable on OnePlus phone affected by this issue.

For information, I also just upgraded my OP6T with 11.1.2.2 and unfortunately, no improvement with the font issue.

bonjour81 avatar Dec 05 '21 17:12 bonjour81

It looks like they broke font selection somehow. We are requesting a monospace font, but it's giving you a variable width font. I'm not sure what could be done from the app level here.

Can you show us where in the code this is being handled?

jaggzh avatar Dec 05 '21 22:12 jaggzh

Looks like it's right here;

https://github.com/connectbot/connectbot/blob/28fcb05a8f741e0aeadc77a729f139a20da56d9c/app/src/main/java/org/connectbot/util/TerminalTextViewOverlay.java#L64

Or here?

https://github.com/connectbot/connectbot/blob/c912fa07000d921c1c1a7c32edc5534ce7f965ef/app/src/main/java/org/connectbot/service/TerminalBridge.java#L182

jaggzh avatar Dec 05 '21 22:12 jaggzh

Surely other programs are requesting fixed width fonts and, if all failing, a fix would have been out? Are we sure this is the only and proper way to request the system's fixed width/mono font, or maybe something else with the way it's coded is resetting it, or causing it to not apply to the actual text used? (Hey, maybe the os software has a new wrapper in it that's grabbing the ssh screens' text. This can be used for tracking, text recognition, text to speech, etc )

jaggzh avatar Dec 24 '21 11:12 jaggzh

Surely other programs are requesting fixed width fonts and, if all failing, a fix would have been out?

All are failing, if they don't use a specific font. e. g. WhatsApp: WhatsApp with system font set to OnePlus Sans.

However, it works fine when the system font selection is set to Roboto (Settings - Customisation - Font):

System Font Selection

WhatsApp with system font set to Roboto

Seems this font customization is implemented by just overriding whatever font was requested. If you want, you can search the OnePlus forum for other issues one would think might get fixed. It seems that setting the system font back to Roboto is deemed sufficient for those that want to use monospace fonts in apps (other than their browser and apps that use explicit fonts).

eljoest avatar Dec 25 '21 08:12 eljoest

👍 Works fine for connectbot!

bonjour81 avatar Dec 25 '21 08:12 bonjour81

Okay, that's a very strange bug. The posted "fix" does work; thank you.

I think, in ConnectBot, many users might appreciate selecting their own font (a global option, maybe with a per-host override). I myself am happy to have the fix though; editing a command in shell was quite problematic. :)

(I wonder why OnePlus is leaving that bug there. I'm going to guess either):

  1. When overriding the setTypeface() they aren't accounting for the MONOSPACE request (or maybe they ignore them all: "normal, sans, serif, monospace")
  2. They might be trying to encourage apps to not overuse fixed-width fonts??

Anyway. Little use in continuing to speculate. (I've only briefly glanced through their repositories and have no clue where that stuff is.)

However, it works fine when the system font selection is set to Roboto (Settings - Customisation - Font):

System Font Selection

jaggzh avatar Dec 25 '21 17:12 jaggzh

Looks like only monospace is ignored (from what's available in WhatsApp) 🤷‍♂️ No idea about the typefaces (sans, serif etc).

OnePlus Sans

Roboto

eljoest avatar Dec 25 '21 18:12 eljoest

This is also an issue on the S22 Ultra running Android 12. Will double check font settings but default font is set to Samsung Sans.

danieldjewell avatar Feb 27 '22 19:02 danieldjewell

Same on Samsung S10e with Android 12. Looks like it's now broken everywhere. Just gives us a font selection so we can choose ourselves.

ygoe avatar May 14 '22 18:05 ygoe

I have the same issue on Motorola Moto G Power (2021). The font in Connectbot is monospaced with the default "Moto" style. However, I was using a custom style with different font, and Connectbot was using a variable width font. It turns out Connectbot is using monospaced font if and only if I select the first font in the style customization dialog. There are 4 fonts available, selecting any font other than number 1 triggers the bug.

proski avatar Dec 10 '22 05:12 proski

I tried setting the fonts to monospaced in the the xml files as suggested online, but it had no effect with non-default styles active. I assume the non-default styles on Motorola Moto G Power (2021) don't define the monospaced font. The fix is probably shipping a font with the Connectbot app or using an existing monospace font by name.

proski avatar Jan 21 '23 08:01 proski

Same problem with fonts on Motorola g pure in Android 12.

gbrbc avatar Jan 30 '23 19:01 gbrbc