I created a component library in react using styled component. The library contains some custom fonts, in different formats, woff, woff,eot, tff, otf and etc. when I use the fonts inside the component library, the fonts works as it should.
The problem arises, when I import the library in another react project. When I look at the node modules, I can se that the fonts are included. The project is bade using React and Next.js. am I missing some important steps to use these fonts? I don´t get any error. The application, just use the fallback font specified. I I´m not interested in changing the font of my of my whole application. I want to be able to access the font exported with my component Library, and use them in some places og my application.
An example: My component Library contains the component "Headline", which use a custom font.
export const h1CSS = cssStyled`
margin-top: ...;
margin-bottom: ...;
line-height: ...;
font-weight: ...;
color: ...;
font-family: "Some_custom_Font";
font-style: normal;
margin-top: 0;
text-rendering: optimizeLegibility;
`;
In the application, which import the component Library, I can use the Headline component. The only problem is that the headline component does not have the custom font, when used inside my application.