Search code examples
arcgisesriarcgis-js-api

ArcGIS for JavaScript 4.21 Emoji in textSymbol


Hello I'm using ArcGIS for JavaScript 4.21

I was abel to create a Graphic with poligon. I want to se a title to polygon so I have created another object above it. That object have a type "text" it is a SimpleText object. And it works fine with simple text with letters. But if someone use a Emoji in text it returns a this exception:

[esri.views.2d.engine.webgl.TextureManager] k {name: 'mapview-invalid-resource', details: undefined, message: "Couldn't find font josefin-slab-regular. Falling back to Arial Unicode MS Regular"}  

I think it is because of unicode, but in prevous version 3.32, I was able to use Emojies. I can't find out a solution to deal with it. So I want to ask if anyone has encountered this problem. Thank you.

here is my example in code pan. Problem is on row 144. If you change text: "👩" to text: "Helo" it works.


Solution

  • Tomáš, I don't think that will work.

    In 4x, the supported fonts to use with TextSymbol on graphics are limited to the list at https://developers.arcgis.com/javascript/latest/labeling/#fonts-for-featurelayer-csvlayer-and-streamlayer.

    In 3x, it worked quite differently, so the font support for TextSymbol was dependent on that specific machines general browser/OS support of fonts.