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

Fontweights style not working #3001

Open
baesslerpa opened this issue Dec 17, 2024 · 0 comments
Open

Fontweights style not working #3001

baesslerpa opened this issue Dec 17, 2024 · 0 comments

Comments

@baesslerpa
Copy link

baesslerpa commented Dec 17, 2024

import { PDFViewer, Document, Page, View, Text } from '@react-pdf/renderer';

function App() {
  return (
    <>
      <PDFViewer>
        <Document>
          <Page size="A4" style={{}}>
            <View style={{ fontWeight: 700 }}>
              <Text>Section #1</Text>
            </View>
            <View style={{ fontWeight: 'normal' }}>
              <Text>Section #2</Text>
            </View>
          </Page>
        </Document>
      </PDFViewer>
    </>
  );
}

export default App;

https://stackblitz.com/edit/vitejs-vite-389pzyqw

in production app im using

Font.register({
  family: 'Proxima',
  fonts: [
    { fontWeight: 'normal', src: '/fonts/ProximaNovaCondensed-Regular.ttf' },
    {
      fontWeight: 'bold',
      src: '/fonts/ProximaNovaCondensed-Bold.ttf',
    },
  ],
});

which either renders all fonts bold or none, depending on which style is first applied

opening a new issue, since all similar are closed.
using this minimal example, i still dont get the fontweights applied.

@baesslerpa baesslerpa changed the title Fontweights still not working Fontweights style not working Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant