raelgc / scudcloud

ScudCloud - Slack for Linux
https://launchpad.net/~rael-gc/+archive/ubuntu/scudcloud
MIT License
1.22k stars 99 forks source link

Fixed width font on inline code blocks #488

Closed meshy closed 7 years ago

meshy commented 8 years ago

ScudCloud Version

Paste the output for scudcloud --version below:

/usr/lib/python3.5/site-packages/scudcloud/notifier.py:3: PyGIWarning: Notify was imported without specifying a version first. Use gi.require_version('Notify', '0.7') before import to ensure that the right version gets loaded.
  from gi.repository import Notify
ScudCloud 1.31
Python 3.5.2
Qt 4.8.7
PyQt 4.11.4
SIP 4.18

Distro and Desktop info

Code in backticks (ie ````) appear in a fixed-width font (as on the slack website): screenshot from 2016-09-08 09-42-02

Actual behavior

Code does not appear in a fixed width font: screenshot from 2016-09-08 09-42-17

Steps to reproduce

  1. Type test in the message box at the bottom.
raelgc commented 8 years ago

Hi @meshy and thank you for reporting this issue.

Make sure any equivalent of ttf-mscorefonts-installer or ttf-ms-* is installed (they provide Courier New.

meshy commented 8 years ago

Would it be possible to define a fallback font instead? I'd rather not install those fonts, as they tend to mess up web-browsing.

raelgc commented 8 years ago

Any of this family: Monaco, Menlo, Consolas, Courier New, monospace.

meshy commented 8 years ago

I don't have any of those as explicit fonts, but I am aware that in a browser monospace should fall back to a monospace font. Does scudcloud use anything akin to a web (browser) view to render the UI?

If so, perhaps this is a bug with the underlying library?

raelgc commented 8 years ago

Yeap, it uses qtwebview, which relies in webkit. But its using a kind-of old version, which has some issues with CSS and fonts. There is the qt5 branch, which uses a new, but still has issue with systray.

meshy commented 8 years ago

Aah, I see. In that case, I guess I'll just put up with it for the moment! Thanks for looking into it for me :)

raelgc commented 8 years ago

Just thinking in another fix to avoid font install: if you know any fixed width font in your system, you can edit the resources/resources.css file and add it to the these line:

pre, pre > span { font-family: Monaco,Menlo,Consolas,"Courier New",monospace; }

Not sure if you're using a package manager, so maybe any update probably will overwrite this file (in .deb packages you can use dpkg-divert to avoid this).

raelgc commented 7 years ago

Hi @meshy, is this still an issue for you after the upgrade to qt5?

meshy commented 7 years ago

I'm afraid I switched over the the official Slack client for the moment, so I'm unable to test this, sorry.

raelgc commented 7 years ago

@meshy no worries, the official app is awesome