I am trying to use a font from a local .otf
file inside my project's directory in order to style the text within the inputs of the credit card form provided by Stripe Elements.
As this is a React project, I have been making use of the react-stripe-elements
library. I have been referencing the following docs in tandem:
Here is where I attempt to use my desired font by passing it in through the fonts
prop as specified in the react-stripe-elements
docs:
<Elements
fonts={[
{
family: 'geog',
src: 'url(../../../shared/styles/fonts/Geogtq-Rg.otf)',
style: 'normal',
weight: '400',
},
]}
>
<StripeCCForm />
</Elements>
With this code, I get the following error:
Invalid src value in font configuration: ../../../shared/styles/fonts/Geogtq-Rg.otf. URLs have to start with 'https://' or 'data:'
I was under the impression that the src
value could be a relative path to a local font, so I am quite confused as to why I am getting this error. Any insight would be greatly appreciated!