Clipboard history shows tofu (questions mark character) for rich text since Sonoma update

Hello,
An image is worth a thousand words, so here's a screenshot:

Device information:

  • Type of Mac: MacBook Pro 2021 14" M1 Pro
  • macOS version: Sonoma 14.1
  • BetterTouchTool version: 4.314

Just before updating to Sonoma, I didn't have the issue.

I also updated BTT recently, but I can't remember if I used clipboard history with rich text after the BTT update and prior to the macOS update.

Please let me know if you need any further information.

Have a great day, and thank you for Better Touch Tool!

Louis

rich text in general seems to be fine, however there apparently is some issue with custom fonts. Are you also using some custom font there?

I can paste it, yes, it's rendering that is broken. It wasn't broken before, with the exact same versions.

IntelliJ IDEA (or any JetBrains IDE for that matter) is using JetBrains Mono, which I happen to have installed globally on my computer, not just in the IDE.

that makes sense, there was another user who also had a similar font installed globally, experiencing the same. I’ll try to figure out whether this can be fixed in BTT!

I just tried Jetbrains Mono in Android Studio, but could still copy & display the text fine. Will check whether this is something specific to globally installed fonts.

//edit: yep, as soon as I installed the Jetbrains Mono font globally the issue appeared. Very strange!

I think I found the issue (weird/buggy new behavior on Sonoma) and a workaround . It's included in 4.315 alpha!

1 Like

Just installed the alpha, and it's working great, thank you, that was really fast! Thank you very much, expectations exceeded :heart:

What did Sonoma do that led to this issue?

BTW, I'm curious about what you're using Android Studio for, now :smile:

it‘s something pretty specific that happens when asking the clipboard for specific datatypes. One of the datatypes I used for rich text, doesn’t include the correct font info anymore (I haven’t looked into the details)

I’m still doing some freelance Android and iOS enterprise work from time to time (some projects I started a long time ago and can not just abandon ;-))

Just got the issue again with the alpha, but with another piece of rich text.

Here are my reproducing steps:

  1. Open the following link to highlight into Google Chrome: SourceType  |  Android Developers
  2. Copy the highlighted text (MOON_PHASE_TYPE_STRING)
  3. Look into clipboard history

Mhm that seems to work fine here. Do you have any special font settings in Chrome?

Does it work if you paste this into some other rich text field? (e.g. notes or textedit)

I also have this issue.

I'm seeing this today as well with markdown text copied from VS Code. It looks like since Code is an Electron app, it's copying it as HTML/rich text. Code is using fonts I installed system wide.

Pasting works fine, it's just the preview in the Clipboard history that is messed up.

BetterTouchTool 4.361
macOS 14.2.1

Interestingly, copying and pasting the same text from VS Code to Word, and then copying it again from Word works fine. That is to say, BetterTouchTool's Clipboard history preview works fine with rich text from Word.

I'm also not seeing any preview issues copying from Safari or Chrome. So far just VS Code, latest version.

Wait, never mind. Copying from VS Code directly and pasting to a rich text document in Text Edit results in the same issue in Text Edit, even with BetterTouchTool not running.

Subsequently changing the font in Text Edit, even to the same font used in VS Code fixes it in Text Edit.

Pasting into Notes works fine, however.

It looks like copy and pasting from VS Code to some other apps with rich text has the same result. I just tried an RTF document in DEVONthink.

For now, I've just disabled copying with syntax highlighting in VS Code, which works fine. This is probably how I want Code to work anyway, so that should resolve my direct issue. The setting is editor.copyWithSyntaxHighlighting in Code.

This bug is still interesting, however.

I believe it‘s some weird macOS bug, good to know it happens when pasting into other apps as well! I’ll try to collect more details.

1 Like

I just saw this forum topic, and realized I should have replied there instead. I just happened to find this topic first. :slight_smile:

I also wanted to report that I tried a few different fonts in VS Code, and some work and some don't. It looks like it might be happening with any of my user-installed fonts, but not the fonts that are part of macOS.

yes, definitely only user fonts!

1 Like

Here's a perhaps related question about creating NSAttributedStrings from HTML with font: objective c - Why am I seeing different behavior in macOS 14 when creating NSAttributedString from HTML vs doing the same thing with initWithString:attributes:? - Stack Overflow

I'm only seeing this behavior when the clipboard content is public.html that specifies a user font.

What does BetterTouchTool do to display public.html clipboards?

Also, I wonder if this is a bug, or intentional on Apple's part, similar to Safari not loading user fonts?

even if they didn't want to load user fonts, it should fall back to a renderable font when rendering the NSAttributedString in a NSTextView - not to the "LastResort" font. For me this looks very much like a bug - especially as it has worked fine for many years.

BTT already tries to workaround this by requesting a non HTML format like rtfd instead, but some apps only put a HTML version into the clipboard.
I'll add a check to see whether the last resort font is used and if so, use the standard system font instead.

1 Like

That makes sense. Thanks for the explanation and plans!