Open MarinosTBH opened 3 weeks ago
If i add these lines :
const DocumentTemplate = ({ tw, config, t }) => (
<Document>
<Page size="A4" style={tw('font-helvetica')}>
<View style={tw('flex flex-col w-full h-full bg-white-basic relative')}>
<Header tw={tw} config={config} t={t} />
<SubHeader tw={tw} config={config} t={t} />
<Text style={tw('font-semibold')}>
This is a semibold sentence
</Text>
<Text style={tw('font-bold')}>
This is a bold sentence
</Text>
<Text style={tw('font-thin')}>
This is a thin sentence
</Text>
</View>
</Page>
</Document>
);
Still does not work
Hey @MarinosTBH, as with #22, see if the React-pdf Font module can help you.
I can confirm I have had the same issue attempting to use/configure fontWeight with tailwind.
Edit: As I'm digging through what I thought was a solution using the react-pdf stylesheet with out of the box fonts, I'm finding that this issue could very well be stemming from that package. See diegomura/react-pdf/issues#2730 and the many issues referenced there.
@aanckar is there another solution to find here? If there is no path forward for fontWeight via tailwind in this package, I propose an update to the README to steer folks towards the Font module (or at least explaining the persisting issue).
Not any font weight is working here, font-thin font-weight: 100; font-extralight font-weight: 200; font-light font-weight: 300; font-normal font-weight: 400; font-medium font-weight: 500; font-semibold font-weight: 600; font-bold font-weight: 700; font-extrabold font-weight: 800; font-black font-weight: 900; Any one faced this problem ? i'm using the PDFViewer from react pdf and want to show the document with its styles always : This is the basic file ::