nerd-fonts icon indicating copy to clipboard operation
nerd-fonts copied to clipboard

patcher: Fix grave (backtick) zero width

Open Finii opened this issue 3 years ago • 2 comments

Description

[why] In ligature-enabled environments the accent grave will be rendered as zero width, thus overlapping with the next character (in some source fonts).

The problem is, that the glyph type in the sourcefonts is set to 'auto', and fontforge exports these as 'mark' - the patched font will be broken.

[how] There is no way we can get that glyph to be 'auto', but we can force it to be an ordinary 'baseglyph' instead, and that will be respected on export.

Maybe I should raise an Issue at fontforge... maybe later.

Fixes: #858 Fixes: #582

Requirements / Checklist

What does this Pull Request (PR) do?

Always set the glyph type of grave to 'just a normal glyph'.

How should this be manually tested?

Use some patched font in a ligatures enabled environment, e.g. Writer, Word, VisualStudio, ... type in one "`" and the cursor should advance one slot.

Any background context you can provide?

https://github.com/adam7/delugia-code/pull/11

The ~~bug~~ peculiar behavior of fontforge is fixed:

  • head (3253fff88) :heavy_check_mark:
  • 20220308 release :heavy_check_mark:
  • 20201107 release :negative_squared_cross_mark:

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

'Before' screenshots are in Issue #585. After this the glyph will always be 'one width' wide.

image

Finii avatar Jul 07 '22 11:07 Finii

Not all to-be-patched fonts contain a grave :grimacing: Force push.

Finii avatar Jul 07 '22 11:07 Finii

This commit fixed the behaviour of fontforge:

image

Finii avatar Jul 07 '22 14:07 Finii