react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

External font is not working like Denmark Causten calibri

Open Ayush2014Kira opened this issue 1 year ago • 3 comments

import RobotoMedium from "../../../../assets/fonts/Roboto/Roboto-Medium.ttf"; import RobotoBold from "../../../../assets/fonts/Roboto/Roboto-Bold.ttf"; import Denmark from "../../../../assets/fonts/Denmark/DENMARK.ttf"; import CaustenExtraBold from "../../../../assets/fonts/Causten/CaustenExtraBold.ttf"; import CalibriBold from "../../../../assets/fonts/calibri/CalibriBold.ttf"; import CalibriRegular from "../../../../assets/fonts/calibri/CalibriRegular.ttf"; Font.register({ family: "Ageo-Regular", src: RobotoMedium, fontWeight: 400, });

Font.register({ family: "Ageo-Bold", src: RobotoBold, fontWeight: 700, });

Font.register({ family: "Denmark", src: Denmark, });

Font.register({ family: "CaustenExtraBold", src: CaustenExtraBold, });

Font.register({ family: "CalibriBold", src: CalibriBold, });

Font.register({ family: "CalibriRegular", src: CalibriRegular, }); Font.register({ family: "Ageo-Italic", src: AgeoItalic, fontWeight: 400, });

onst styles = StyleSheet.create({ container: { width: "100%", height: window.innerHeight, }, body: { paddingTop: 10, paddingBottom: 130, paddingHorizontal: 35, fontSize: 12, fontFamily: "Ageo-Italic", },) in this code apply font is not working only roboto font working how to any other font add in this code

Ayush2014Kira avatar Jun 05 '24 06:06 Ayush2014Kira

I have a problem like this too. I have a project that has been using react-pdf successfully with various fonts but now, after one of the last few updates, they no longer work.

I don't think it necessarily has to do with the font type, since I tried a few different fonts of various types like .otf, .ttc, and .ttf and many did not work. From my limited testing, it seems that only specific fonts work.

The fonts I am trying to use are Century Gothic, Proxima Nova, and Helvetica.

corbinday avatar Jun 13 '24 23:06 corbinday

@Ayush2014Kira See this thread: https://github.com/diegomura/react-pdf/issues/2756#issuecomment-2165275094

corbinday avatar Jun 14 '24 16:06 corbinday

@Ayush2014Kira See this thread: https://github.com/diegomura/react-pdf/issues/2756#issuecomment-2165275094

Yes , after I use google fonts And pdf working but this is a temporary solution .

Ayush2014Kira avatar Jun 14 '24 16:06 Ayush2014Kira

i am getting same issue. How can fix this pls let me know anyone. Thanks in advance.

santrajyadav196 avatar Jan 13 '25 07:01 santrajyadav196