vim-copy-as-rtf icon indicating copy to clipboard operation
vim-copy-as-rtf copied to clipboard

Fonts aren't set in the output RTF on Monterey

Open tenderlove opened this issue 3 years ago • 0 comments

This isn't a bug in this plugin, but I thought I'd make a ticket here in case anyone else runs across the problem. Apparently textutil ignores fonts specified in HTML if the HTML is sent to textutil via stdin:

[aaron@tc-lan-adapter💪 ~]$ cat /tmp/out.txt.html | grep Inconsolata
pre { white-space: pre-wrap; font-family: 'Inconsolata', monospace; color: #000000; background-color: #ffffff; }
body { font-family: 'Inconsolata', monospace; color: #000000; background-color: #ffffff; }
[aaron@tc-lan-adapter💪 ~]$ textutil -format html -convert rtf -stdout /tmp/out.txt.html | grep Inconsolata
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 Inconsolata-Regular;}
[aaron@tc-lan-adapter💪 ~]$ cat /tmp/out.txt.html | textutil -format html -convert rtf -stdout -stdin | grep Inconsolata
[aaron@tc-lan-adapter💪 ~]$

You can see the font is included in the RTF when you give textutil the file name, but it isn't when you pipe though stdin. Since this plugin pipes through stdin, the font info gets lost. It definitely used to work on Big Sur because I use this plugin all the time (thank you!!!)

I am trying to file a ticket with Apple but the reporting system is not cooperating. I'll update here when I can finally get it filed.

tenderlove avatar Jan 28 '22 20:01 tenderlove