nelsam / vidar

vidar is a highly experimental Go editor, written in Go, using gxui
The Unlicense
50 stars 7 forks source link

Incorrect display of characters #156

Closed Kvaz1r closed 5 years ago

Kvaz1r commented 5 years ago

Description

Some symbols are displaying incorrect.

Steps to reproduce

  1. Open file that contains special unicode characters, for example: vidar E:\Projects\Github\vidar\navigator\tree_button.go

Expected behavior

...
    {
        expanded:  '▼',
        collapsed: '►',
    },
...

Actual behavior

p2

nelsam commented 5 years ago

This is expected. Some fonts have characters for those code points, some don't. The reason for the preferred list is to actually query the font for those code points, and fall back to backups when those code points don't exist in the font.

The code that checks the current font to see if they support those characters (and fall back when they don't) is here

The default font in vidar is coming from here

I have an override set on my system in ~/.config/vidar/settings.toml to choose PTM55F, then fall back to Inconsolata-Regular, and only if neither of those two can be found do I fall back to the gxui default. Here's my settings.toml:

[[fonts]]
  Name = "PTM55F"
  Size = 12

[[fonts]]
  Name = "Inconsolata-Regular"
  Size = 12

You can see that PTM55F displays the arrows correctly in my screenshot: the screenshot

I'll leave this open because we might want to regenerate the gxfont in gxui (newer versions might have added some unicode characters), but vidar is working correctly in this case.

Kvaz1r commented 5 years ago

Right, thanks, now I see. I'll also change font in settings.