[MlMt] Setting a custom monospace font for code

Patrick Schratz patrick.schratz at gmail.com
Sun May 10 12:36:02 EDT 2020


Hi Denis,

Thanks! I already had custom fonts set via the official settings.
Even though I am somewhat decent in CSS I could not find the class for 
the code font and simply using `code{}` did not work.

I had not yet inspected the hidden settings - thanks for the pointer! 
Works great now. Even though I would like to have a setting that can be 
backed up and would like to avoid using the `defaults` command.

Maybe somehow can shine some light on how to add the `code` CSS class 
into `~/Library/Application 
Support/MailMate/Resources/MmMessagesWebView/stylesheet.css`.

I am so happy that I can seamlessly type my emails using vim keybinding 
in my favorite editor with markdown support.
Seems weird to freak out about this in 2020 but apparently its legit :)

On 10 May 2020, at 17:50, Denis Ricard via mailmate wrote:

> It depends on what you want to use the font with. If it’s all text 
> messages, and not only the code part, then it’s like setting any 
> font in MailMate. You first choose `Show Fonts` from the `Format` 
> menu, then you click in a plain text message, and change the font 
> (sometimes you need to change the font size back and forth to make the 
> change register).
>
> That’s the way to change fonts in all the interface of MailMate by 
> the way (list of emails, etc.).
>
>
> If you want a specific font just for the code snippets (which would 
> apply in both plain text and html messages), there is a way with a 
> [hidden prefs](https://manual.mailmate-app.com/hidden_preferences) 
> which I use. In terminal insert this (then return):
>
> ```bash
> defaults write com.freron.MailMate MmDefaultCSS -string 'code { 
> font-family: “Fira Code”, Monaco, monospace; }'
> ```
>
> And restart Mailmate.
>
> As the hidden prefs document mentions, it’s “strongly 
> discouraged” (I’m not sure why) but I use it and it works fine for 
> me.
>
> Best regards,
> Denis
>
> On 10 May 2020, at 4:36, Patrick Schratz wrote:
>
>> Hi,
>>
>> I’ve successfully set custom fonts for HTML and text messages (in 
>> ~/Library/Application 
>> Support/MailMate/Resources/MmMessagesWebView/stylesheet.css) and 
>> enabled pygments syntax highlighting via the bundle.
>>
>> https://freron.lighthouseapp.com/projects/58672/tickets/2029-different-font-support-for-plain-text-and-html-mails
>>
>> Is there a way to also set the monospace font separately? I’d like 
>> to use a font with ligatures like Fira Code.
>>
>> Best, Patrick
>> _______________________________________________
>> mailmate mailing list
>> mailmate at lists.freron.com
>> https://lists.freron.com/listinfo/mailmate



> _______________________________________________
> mailmate mailing list
> mailmate at lists.freron.com
> https://lists.freron.com/listinfo/mailmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20200510/6686d48a/attachment.htm>


More information about the mailmate mailing list