#wullvie_elements-custom-fonts

1 messages ยท Page 1 of 1 (latest)

hard mossBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1267510669335592980

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

winged violet
#

I have also tried adjusting the element call to the following:

#

const elements = stripe.elements({ clientSecret: clientSecret, appearance: appearance }, options);

vagrant void
#

We don't have a good example of setting custom fonts. I don't know that it accepts a source in the parameter itself though. Let me try to track down an example.

winged violet
#

oh wait i see.. ugh easy miss

#

one sec

#

const fonts = [
{
family: 'SamsungOne-700',
weight: 700,
src: url(../fonts/SamsungOne-700.ttf)
}
]
const elements = stripe.elements({ clientSecret: clientSecret, appearance: appearance, fonts: fonts})

vagrant void
winged violet
#

still having trouble getting it to render. no errors from using the last snippet tho

#

req_M18U3Yo9d1J1e7

vagrant void
#

Okay, then I would recommend reviewing the Network and Sources tabs of your developer console to see if the font is being retrieved

winged violet
#

after updating the src i see now Invalid font src configuration value. Expected "local(", "url(", or end of input but "." found."

#

maybe .ttf is the issue

vagrant void
#

Okay, getting somewhere! New errors are exciting

winged violet
#

i know the file path is correct - referencing the same url in other places same file and font loads as expected

vagrant void
#

Yeah the tricky part is identifying if we are doing something "fancy" to the URL

winged violet
#

passing url(...) is an allowed format here i think - from what i've seen at least

#

I

#

I'll try passing a hosted file instead of local see if that at least goes through

#

oh wow that worked lol

vagrant void
#

Interesting ๐Ÿค“

winged violet
#

ok so I'll see if i can figure out a way to get the local file path url to work, if not this will do!

vagrant void
#

Can you share what the font object looks like now? I'm trying to repro

winged violet
#

src: 'url(https://maestro.sickksoftware.com/assets/fonts/SamsungOne-700.ttf)'

#

same font, just using the public file loc from my site

vagrant void
#

Okay.... interesting

winged violet
#

i'll play around with trying to get a local url to work otherwise I'm all set. thanks again for the help!

vagrant void
#

Sure thing, it's why we're here ๐Ÿ™‚