typeface.js
User / Developer Forum
A solution for cut fonts
Gildas P.
|
29 Jan 2010 4:55
Hi.
For some time now I had a common problem, severely recoreded on this forum and others, but for witch I didn't found any solution anywhere.

The problem concerns big fonts and accentuated foreign ones (mainly), which will show the font cut on the top, on the bottom, or both.
Seems like for some reason the font is displayed in a smaller box than it would need.


After trying every css comnation possible I desperatly found myself blindly tweaking the myfont.typeface.js... and finally found the solution !

The trick is to position the font lower in the "view" box, to show the top of the font, and then to expand the box itself, to show the bottom of the font too.

The 2 parameters to tweak are on the bottom of the source code page :

"ascender":1042
the value needs to be increased, until the top of your font is shown


"lineHeight":1450
the value needs to be increased, until the bottom of your font is shown too


ajusting these you can control the display of any font you'd generate with typeface.

the "resolution" parameter specifies the main size of your font (sometines a font is shown bigger than the others, no reason for that), but doesn't change the box size or position (the box keeps the same proportion as the font).

have fun !

some exemple : http://www.veroniquevienne.com/beta/

Post a Reply
YOUR NAME
YOUR COMMENT
We don't support HTML, but please use [quote] ... [/quote] tags around quotes.