yabar icon indicating copy to clipboard operation
yabar copied to clipboard

Pango unknown glyph with certain fonts

Open NBonaparte opened this issue 8 years ago • 9 comments

Pango has a certain "feature" where spaces use the font for the character before the space. As a result, there can be some undesirable results:

  • fonts without space characters will display tofu symbols (example here).
  • when switching between symbolic and monospace fonts, the width will be incorrect (it uses the symbol font's space).

One solution to the former is to add a fallback attribute to each space. With the latter, a specific font family can be applied through another attribute.

So far, the only workaround I've come up with is looping through each buffer text, finding any spaces, and applying a fallback attribute to every space.

NBonaparte avatar Feb 05 '17 02:02 NBonaparte

It is already possible to specify multiple (fallback) fonts in yabar, e.g.:

font: "Droid Sans, FontAwesome Bold 9";

Doesn't this cover the missing spaces?

jacksgt avatar Feb 05 '17 13:02 jacksgt

No, for some reason it doesn't switch fonts for spaces, so we have to do it manually.

FontAwesome has spaces, but Material Design Icons doesn't. If you use FontAwesome with a monospace font, the spaces will be that of FontAwesome, rather than that of the monospace one, making it look unbalanced. Material Design Icons just shows tofu symbols.

Maybe this should be set as a compile flag?

Here's an example for the wrong spacing size (fonts are Source Code Pro and FontAwesome). First one uses <tt> </tt> instead of just a space, making them have proper width. 2017-02-05-155158_1920x24_scrot 2017-02-05-155246_1920x24_scrot

NBonaparte avatar Feb 05 '17 16:02 NBonaparte

FontAwesome v5 apparently has no more space character as I'm facing this issue :|.

/edit event internal-spacing does output a tofu symbol.

soyuka avatar Jan 28 '18 18:01 soyuka

I use Archlinux and something happened after my last update a week ago. Some icons aren't showing correctly. But I don't my problem is related to this issue. Something happened with FontAwesome 5 I guess

gh67uyyghj avatar Jan 28 '18 19:01 gh67uyyghj

Regarding the FontAwesome5 thing, there is this Arch bug report: https://bugs.archlinux.org/task/56899

Narrat avatar Jan 28 '18 22:01 Narrat

Can't believe Pango still hasn't fixed that. Does the fix_pango branch still fix this issue? I just rebased it onto master.

NBonaparte avatar Jan 28 '18 23:01 NBonaparte

With the fix_pango branch and following fonts font: "DejaVu Sans Mono 10, Siji 10, MaterialDesignIcons 10"; I'm still having those unknown glyphs

Narrat avatar Feb 03 '18 02:02 Narrat

Tried the fix_pango branch without success. I'm using Source Code Pro and awesome 5.

soyuka avatar Feb 12 '18 09:02 soyuka

Updating/installing these packages fixed the issue for me:

otf-font-awesome ttf-font-awesome

soyuka avatar Apr 02 '18 08:04 soyuka