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

280
Vistas
How can I find out in pure javascript if some characters can't get rendered by the font?

Browsers are very smart. https://css-tricks.com/css-basics-fallback-font-stacks-robust-web-typography/ They can find out themselves which characters can't be rendered by the actual font, and render the characters with a fallback.

Unfortunately, we don't have that smartness in pure JS or frameworks like React Native: https://github.com/facebook/react-native/issues/32396

So I have to build this behavior myself for my react native app.

How can I check in pure javascript if a font is unable to render a specific character (if it's e.g: Kanji), so that I can render that specific character myself with a fallback font?

(I can find out which font the character needs with unicode, but I don't want to do that on every text render because it would consume resources (is that right? or is it OK to do that? imagine a text has 500 characters, that would be 500 function calls)). anyway I think it's a better approach (is that right) to do that unicode stuff only onError

So, how can find out in pure javascript if some characters can't get rendered by the font? I basically want to be notified onError, the payload should be the position of the characters within the string.

I know I could find that out if I regex check the supported unicode by my font against the unicode of the text, but that would again consume resources. I want to just render the text in React Native, and then onError catch the errors and render the not working characters with a different working fallback font.

thanks in advance!!

about 4 years ago · Juan Pablo Isaza
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