Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lato font has a bad rendering in NextJS #8377

Open
nicolas-bourles opened this issue Oct 22, 2024 · 2 comments
Open

Lato font has a bad rendering in NextJS #8377

nicolas-bourles opened this issue Oct 22, 2024 · 2 comments
Labels
-- Needs Eng team opinion API related stuff only eng team can answer I Font Bug

Comments

@nicolas-bourles
Copy link

I use the Lato font with a font weight 400, on the framework NextJS, with the font component, and I see a bad rendering of some characters.

Thanks a lot for your help :)

Describe the bug

On display, with the specified font-weight, the font isn't rendered correctly. I have tested with Roboto a font like Lato, and I don't have the same problem.

To Reproduce

On the NextJS framework, use the Lato font like this, font example in a src/common/styled/app/base/fontFace.ts file. By the way, I use Styled Components:

import { Lato } from 'next/font/google'
import { css } from 'styled-components'

const lato = Lato({
  weight: ['400', '700', '900'],
  subsets: ['latin'],
  variable: '--font-lato',
})

const fontsFace = () => css`
  :root {
    --font-lato: ${lato.style.fontFamily};
  }
`

export default fontsFace

After, I use the CSS variable like this:

body {
      font-family: var(--font-lato);
      font-weight: 400;
}

Expected behavior

Like another fonts, I expect to have a good rendering, and not the bad rendering that you can see on the first 2 screenshots below.

Screenshots

Image
Image

Test with the Roboto font with font-weight: 400:
Image
Image

Additional context

Windows 10, Chrome 129.0.6668.101, Firefox 128.3.1esr (64 bits)

@emmamarichal
Copy link
Collaborator

is anyone on the eng team can take a look?
@evanwadams?
or @m4rc1e maybe?

@emmamarichal emmamarichal added the -- Needs Eng team opinion API related stuff only eng team can answer label Oct 23, 2024
@WilsonPhooYK
Copy link

I have this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-- Needs Eng team opinion API related stuff only eng team can answer I Font Bug
Projects
None yet
Development

No branches or pull requests

3 participants