mirage icon indicating copy to clipboard operation
mirage copied to clipboard

Monospace font in code blocks

Open MRAAGH opened this issue 3 years ago • 5 comments

Markdown code block (paragraph surrounded in triple backticks) gets displayed in default font and different color. Usually (in other Matrix clients and other software) a monospace font is used for these blocks.

Mirage:

Element:

Original:

MRAAGH avatar Mar 28 '21 01:03 MRAAGH

They are supposed to use a mono font, the default one being bundled in the application's binary. I assume this is installed from the AUR, so no modification of the package. Right click on a message with a code block, click Debug; is the console itself monospace? Can you post the result of these commands:

  • theme.fontFamily.mono
  • theme.chat.message.styleSheet
  • target.eventContent.contentLabel.text
  • .j Qt.fontFamilies()

mirukana avatar Mar 30 '21 21:03 mirukana

ah, I should have made it a bug then. Here's the output: link

The installation is unmodified indeed.

MRAAGH avatar Mar 30 '21 23:03 MRAAGH

They are supposed to use a mono font, the default one being bundled in the application's binary.

What do you mean by "bundled"? I looked for "Hack" in this repository (filenames and file content) but I couldn't find it. Anyway, I changed the font in the theme file to a monospace font I have installed, and it works now.

MRAAGH avatar Apr 19 '21 16:04 MRAAGH

@MRAAGH changing theme.fontFamily.mono to hack (notice lowercase 'h') helps in something?

Also, do you have this directory in the cloned repo src/fonts/hack?

vSLG avatar Apr 21 '21 12:04 vSLG

@vSLG Sorry, I missed your reply. Yes, I have the src/fonts/hack. Setting font to lowercase hack did not work. Later I was able to fix this issue by setting my fonts in my theme file to my preferred fonts like this:

fontFamily:
    string sans: "Ubuntu,Joypixels"
    string mono: "Ubuntu Mono,Joypixels"

MRAAGH avatar Oct 01 '21 22:10 MRAAGH