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

External font is not working like Denmark Causten calibri #2779

Open
Ayush2014Kira opened this issue Jun 5, 2024 · 3 comments
Open

External font is not working like Denmark Causten calibri #2779

Ayush2014Kira opened this issue Jun 5, 2024 · 3 comments

Comments

@Ayush2014Kira
Copy link

Ayush2014Kira commented Jun 5, 2024

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 Ayush2014Kira changed the title External font is not wokring External font is not working like Denmark Causten calibri Jun 5, 2024
@corbinday
Copy link

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
Copy link

@Ayush2014Kira See this thread: #2756 (comment)

@Ayush2014Kira
Copy link
Author

@Ayush2014Kira See this thread: #2756 (comment)

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

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

2 participants