nicolo-ribaudo / brackets-svg-font

An Adobe Brackets extension to view SVG fonts
http://brackets.dnbard.com/extension/nicolo-ribaudo.brackets-svg-font
MIT License
7 stars 3 forks source link

Cropped display of tall glyphs #9

Closed thany closed 9 years ago

thany commented 9 years ago

Please compare these two: a1 a2

The capital A has a tilde over it, but it's cropped. Perhaps because glyphs are cropped at the CapHeight border. The accents certainly don't exceed above the WinAscent border.

Windows 7 x64, Brackets 1.3, latest freshest FontForge.

nicolo-ribaudo commented 9 years ago

Can you open that file and copy the <font-face/> tag?

thany commented 9 years ago

Ah, from the SVG I assume :) Here it is:

<font-face units-per-em="2048" ascent="1536" descent="-512" />

Hopefully this helps.

nicolo-ribaudo commented 9 years ago

Theorically, the <font-face/> tag should have an accent-height attribute which specifies how tall can be glyphs with accents. (However, LOTS of fonts don't use it :unamused:)

I could just add some more space so that, if the glyph exceeds the value specified in ascent and descent, it won't be cropped.

thany commented 9 years ago

Isn't it possible to work out a workable accent-height from the other attributes? Otherwise the quickest solution (at least for the moment) might indeed simply be some extra space.

If only we'd know how browsers/OSes handle this sort of thing...

nicolo-ribaudo commented 9 years ago

For now, I have just added some space at the top of the glyphs...

You can download the "fixed" version of the extension: https://github.com/nicolo-ribaudo/brackets-svg-font/releases/download/v0.4.5-pre.0/nicolo-ribaudo.brackets-svg-font.v0.4.5-pre.0.zip

Isn't it possible to work out a workable accent-height from the other attributes?

I think I could parse the d attribute... I'm going to fix this next week.

nicolo-ribaudo commented 9 years ago

Fixed :smile: