jeanguyomarch/eovim

Conform to fontconfig spec.

jeanguyomarch opened this issue · 0 comments

Currently, font can be changed by using from vim

set guifont=fontname:fontsize

The parsing is trivial: find the first :, what is on the LHS is the font name, on the RHS is the font size. The font name is then directly passed to the Evas_Textblock.

Turns out that things are not that pretty in real life, as it is possible to specify fonts with great details with fontconfig. And Evas_Textblock actually parses the font as fontconfig formats.
See the fontconfig user manual for details.

So instead of having our own minimal format above, we should just use the fontconfig spec. We just need to force users to specify a font size. For example, to select DejaVu Sans Mono with font size 12 and style Book, this should give:

set guifont=DejaVu\ Sans\ Mono-12:style=Book

This requires to:

  • change the parsing: font size is available after the first dash (what happens if a font contains a dash??)
  • pass everything to the Evas_Textblock
  • update the wiki

Thanks @pcouderc12 for the report.