用CSS修复自定义字体line-height [英] Fix custom font line-height with CSS

查看:121
本文介绍了用CSS修复自定义字体line-height的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在处理新的网路应用程式时使用自订字型时遇到了一个奇怪的问题。

I've been experiencing a strange issue when using a custom font on a new webapp i'm working on.

这种自订字型(FF DIN)似乎有自然的垂直偏心线高度,这迫使我放一些padding-top黑客来补偿像按钮和输入元素顶部空间。

This custom font (FF DIN) Seem to have naturally vertical off-center line-height, which force me to put some padding-top hack to compensate the top space on element like button and input.

示例:绿色字体(Helvetica Neue)正确对齐,我们使用的自定义字体(FF DIN)垂直偏心:

img src =https://i.stack.imgur.com/dAmbJ.pngalt =enter image description here>

有任何已知的方法

谢谢。

推荐答案

最后,我结束了手动修复字体自己,使用帮助从这个答案:

In the end, I've end up manually fixing the font myself, using help from this answer:

UIButton自定义字体垂直对齐

这篇关于用CSS修复自定义字体line-height的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆