Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
Stripe Elements won't load my custom font

I'm using this code to load a custom font for my Stripe card number element:

const elements = stripe.elements({
                    fonts: [
                        {
                            family: 'Avenir-Regular-Bold',
                
                            src: 'url(\'styles/AvenirNextLTPro-Bold.otf\')'
                        }
                    ]
                });

And I'm getting this error about loading said font:

Access to font at 'https://example.com/app/styles/AvenirNextLTPro-Bold.otf' from origin 'https://js.stripe.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have no idea what this means or why Stripe is saying this. Any way I can get my custom font to load?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I fixed it like this:

<?php
header("Access-Control-Allow-Origin: *");

echo file_get_contents('https://example.com/AvenirNextLTPro-Bold.otf');

And then giving the url to this page to Stripe.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda