rhysd / neovim-component

<neovim-editor> WebComponent to embed Neovim to your app with great ease
https://github.com/rhysd/NyaoVim
MIT License
193 stars 18 forks source link

Improve glyph positioning #25

Open moshev opened 8 years ago

moshev commented 8 years ago

Right now font-height is calculated by guesswork, which is completely unneeded given that font-size is the font's height. The guesswork approach can lead to glyphs slightly offset from centre with some fonts, e.g. Courier Prime. You can see a [http://imgur.com/yKblb0I](comparison here).

Additionally, given that we know the height of a line in pixels and the height of a glyph, the margin calculation can be much simpler.