ios-sdk-examples icon indicating copy to clipboard operation
ios-sdk-examples copied to clipboard

Using a Custom Font for a Symbol Layer

Open riastrad opened this issue 7 years ago • 2 comments

Although it seems like it should be straightforward, the expression syntax for referencing a custom font in a symbol layer is a bit different than you might expect. An example showing how to do this properly would be useful.

As I recently learned, in Obj-C this looks like this:

labelLayer.textFontNames = [NSExpression expressionWithFormat:@"{'Custom Font Name'}"];

(h/t @captainbarbosa)

One important thing to note: the custom font must be registered with the style as the SDK currently doesn't support referencing system fonts in map style elements.

riastrad avatar Oct 16 '18 01:10 riastrad

To do this most effectively, I want to include an uncommon font where the difference would be pretty striking. I've settled on using the OpenType font: Subotype Steady

Here's the download link: https://fontlibrary.org/face/subotype/assets/fonts/subotype/d87345db2a2f8c9323e6c8742d5856fb/e247a0bb38b7fe4b146a7e512b2dfef0/SubotypeSteady.otf

And here's what it looks like: screen shot 2018-11-01 at 10 08 52 am

riastrad avatar Nov 01 '18 14:11 riastrad

We should still do this.

captainbarbosa avatar Sep 18 '19 18:09 captainbarbosa