Next.js Discord

Discord Forum

@Vercel/OG - Font Weight Not Applyinjg

Unanswered
Small Münsterländer posted this in #help-forum
Open in Discord
Small MünsterländerOP
Trying to use the image response with nay of the examples, it returns fine except font weight hasnt been applied

Using Nextjs 14.2.2, next/og
<div
  style={{
    height: '100%',
    width: '100%',
    display: 'flex',
    flexDirection: 'column',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#fff',
    fontSize: 32,
    fontWeight: 600,
  }}
>
  <svg
    width="75"
    viewBox="0 0 75 65"
    fill="#000"
    style={{ margin: '0 75px' }}
  >
    <path d="M37.59.25l36.95 64H.64l36.95-64z"></path>
  </svg>
  <div style={{ marginTop: 40 }}>Hello, World</div>
</div>

4 Replies

Northeast Congo Lion
What font are u using
If you import font and only declare 500, 600 won’t load. Especially for next font google etc
@Northeast Congo Lion What font are u using
Small MünsterländerOP
So two issues I think I had that are resolved now:

1. Default font has no font weight, can’t change it

2. Importing variable fonts do not work, you can only import a single font weight.