ThinkGeo.com    |     Documentation    |     Premium Support

Geofont with user defined fonts

Hello there,

I’m need to use a geofont which is in an user folder and not in the application /assets folder and I get an exception.
Can you clarify why I cannot use something like

ps = new PointStyle(new GeoFont(@"/mnt/sdcard/xxxxx/Fonts/Wingdings.ttf", 12), 115, new GeoSolidBrush(color));

Thank you
Patrick.

Hi Patrick,

This is a new feature which should be contained in version 9.0.560.0, please get the version when it’s available and have a try again.

Thanks,
Peter

Hi,
Does it also work on Map Suite on iOS(Xamarin.Forms)?

Hi Syed,

MapSuiteFormsEdition.iOS supports loading custom font.

Loading custom font on MapSuiteFormsEdition.iOS, please following the steps as below:

  1. Add the font to the Resources folder in your project.
  2. Right click on the added Font and select the ‘Properties’ menu option. You need to change the build property ‘Copy to output directory’ to ‘Always copy.’
  3. Add following entry to Info.plist :

UIAppFonts

Wingdings.ttf

  1. Please refer to the following code for load font:
    GeoFont geoFont = new GeoFont(@“Wingdings”, 30);

Note:

  1. Because system reason, on IOS device, the “fontName” parameter of GeoFont is only font name but without the “.ttf” extension, and the “fontName” parameter of GeoFont is font file path with extension on Android device.
  2. IOS will load these fonts at startup, so it pays to use custom fonts sparingly, and it can slow the startup time of your App.

Thanks,