Adjusting Kerning in CSS

前端 未结 6 949
死守一世寂寞
死守一世寂寞 2020-12-31 01:06

Is it possible with CSS to adjust kerning in CSS? I\'d like to be able to kern a block of text such that it will actually look like a block of text (both left and right edge

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 01:37

    As user Typeoneerror answered, letter-spacing does not influence kerning. See the kerning concept at Wikipedia.

    Kerning is not controlled by letter-spacing, and there are no font-kerning for CSS1 or CSS2. The new specification, CSS3, has not been approved as a standard (W3C Recommendation), but there are a property proposed for font-kerning, see 2012 draft,

    https://www.w3.org/TR/css-fonts-3/#font-kerning-prop

    Only specific fonts, like OpenFonts, have this property.

    CSS not "controls kerning", but if using non-zero letter-spacing the "human kerning perception" can be lost. Example: enhance kerning with letter-spacing:-0.1em and lost with letter-spacing:0.5em.

    With CSS1 letter-spacing property you can lost or enhance kerning perception, and into a "letter-spaced text" you can simulate kerning:

    VAST (normal)
    VAST (enhance perception)
    VAST (lost perception)
    SIMULATE: VAST TEXT

    See the above example here.


    EDIT 2014: I not changed the original text above today, I am opening the answer for your changes (Wiki mode), for proofreading and updates. At the moment this is the most voted answer (21 vs 10) and HTML5 will be a recommendation... Please, help to improve this text (and/or the Wikipedia's linked text!).

提交回复
热议问题