Our app loads point geometries from an outside source into a FeatureCollectionLayer which uses a UniqueValueRenderer.
We used an ArcGIS Pro map to define the layer's symbology, exported the definition to JSON using a python script and then used it in the Android app using the Symbol.fromJson(String json) function.
This worked perfectly fine when the layer's symbols were circles and squares ("type":"CIMVectorMarker" in the JSON), but after switching it to symbols from a custom font ("type":"CIMCharacterMarker" in the JSON), the Android map simply rendered letters and symbols from a default font instead.
I'm able to include the .ttf file in the Android app and load it into an android.graphics.Typeface object. I've tested it on TextViews and it works as expected. But I don't know how and where I would register the font so that the map is able to render it as well. Is that even possible?
If it isn't possible, I'm interested in any other way to carry a (character-based) symbology definition from an ArcGIS Pro map to an Android SDK FeatureCollectionLayer. We're not looking into solutions that replace the FeatureCollectionLayer with a different kind of layer, but if there's a way to define the symbology definition in, say, an MMPK layer, load that in the Android app and copy it into our FeatureCollectionLayer, that could work.
Solved! Go to Solution.
@MTrcek - thanks for sharing this. If the font is not installed on the Android system, the map will not pick it up. We haven't tested this workflow, so its currently unclear if there is a way to install your custom font on the Android system to be used by the map.
An alternative could be to add the symbols to a Mobile Style file. When you add CharacterMarkers to mobile style files the markers get vectorized into CIMVectorMarkers, so your custom font won't be required.
@MTrcek - thanks for sharing this. If the font is not installed on the Android system, the map will not pick it up. We haven't tested this workflow, so its currently unclear if there is a way to install your custom font on the Android system to be used by the map.
An alternative could be to add the symbols to a Mobile Style file. When you add CharacterMarkers to mobile style files the markers get vectorized into CIMVectorMarkers, so your custom font won't be required.
@GuntherHeppner - We've since managed to make a satisfactory map without fonts, but it's still a low priority feature we'd like to have and using Mobile Style files does work. Thank you for your help!
We've since managed to make a satisfactory map without fonts, but it's still a low priority feature we'd like to have and using Mobile Style files does work. Thank you for your help! Burgers at McDonald's Menu