Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fonts rendering different if user has them installed... Can I force consistency? [duplicate]

Tags:

html

css

fonts

I'm building a site that uses Googles Webfont Oswald. Some of my coworkers are experiencing a different lineheight, which breaks the site. After researching, it's because they have the font installed, while most other people dont. This difference causes the issue. Is there any way to force the browser to use the webfont, and not render it with the native font?

more info.

I am specifying the line-height, height, and font-size as the same size.

like image 249
lostPixels Avatar asked Feb 21 '13 22:02

lostPixels


People also ask

Why do fonts render differently in different browsers?

If you notice that your text fonts look different on different browsers, it is because different browsers and devices use different rendering engines, and therefore may result in minor differences. Sometimes these minor differences can have a domino effect.

Does font affect rendering and layout phases?

On Windows, the font format has a significant impact on the rendering. The crucial difference is between PostScript-based and TrueType-based fonts, and not the way these are brought into the browser—JavaScript vs. pure CSS, raw fonts vs. “real” Web fonts, etc.

How does font rendering work?

The process of transforming font outlines into pixels is called rasterization. The operating system's text-rendering engine places the outline (ie the shape) of each character at the desired font size on a pixel grid. Next, it colours all the pixels whose centre is inside the outline (see image below).

How do you fix Fout?

The best way to deal with FOUT is to make the transition between the fallback font and web font smooth. To achieve that we need to: Choose a suitable fallback system font that matches the asynchronously loaded font as closely as possible. Adjust the font styles ( font-size , line-height , letter-spacing , etc.)


1 Answers

Fixed this issue for me, removed from my css file:

text-rendering: optimizelegibility;

like image 108
brockis Avatar answered Nov 15 '22 04:11

brockis