In my Web application I am using google font 'Lato'.Now Requirement is I should use 'Roboto' font for my web application.

I replace Lato font with Roboto but This reflect major change in terms of spacing in whole Web application.Where I am doing mistake?

I cant share whole page screenshot.

Original with LatoThis is my original part

Disturb with Robotoenter image description here

3

Best Answer


Every font-family have own letter spacing and line-height. Now you need yo set re-structure your letter spacing and line-height!

Definitely in specifiing sizes for elements. If you need to translate the site to other language, you meet the same problems. If you change some text you have the same problems. And so on.

Everyting depending on text should not have explicit sizes (width at least). So when you change te text or the font, element just enlarges or shrinks without negative effect in most cases.

The only exception is placing some set of elements inside of one raw or limiting their max-width. These can cause problems if more text appears or new font is wider. Anyway, it's not good if the whole site consists of such elements. And Roboto is not wider than Lato, so it's not your case.

Is it possible to view your webpage ?

You can also change the spacing between letters using the css property "letter-spacing"

h1 {letter-spacing: 2px;}h2 {letter-spacing: 5px;}
<h1>SAMPLE</h1><h2>SAMPLE</h2>