iOS Font Customization only works with Noto Sans Regular #3679
-
Hi, I'm attempting to customize the font I'm using for one of my symbol layers but I'm running into an issue where if I use anything other than Noto Sans Regular the layer doesn't render at all — symbols and text. Notably, if I don't include the textFontNames property on the layer the layer will also not render. For example, I've tried without success: Snippet of my current code: var markerLayer: MLNSymbolStyleLayer {
let layer = MLNSymbolStyleLayer(identifier: markerId, source: source)
layer.iconImageName = NSExpression(forKeyPath: "iconKey")
layer.iconColor = NSExpression(forConstantValue: UIColor.red)
layer.iconAllowsOverlap = NSExpression(forConstantValue: true)
layer.iconIgnoresPlacement = NSExpression(forConstantValue: true)
layer.iconScale = NSExpression(forConstantValue: 1)
layer.text = NSExpression(forKeyPath: showCallSigns ? "callSign" : "name")
layer.textFontNames = NSExpression(forConstantValue: ["Noto Sans Regular"])
layer.textFontSize = NSExpression(forConstantValue: 13)
layer.textHaloWidth = NSExpression(forConstantValue: 1.5)
layer.textHaloColor = NSExpression(forConstantValue: UIColor.secondarySystemBackground)
layer.textColor = NSExpression(forConstantValue: UIColor.label) Unsure if I'm hitting a bug or just not customizing the font correctly. I've looked through the documentation but not sure I've found anything conclusive. Running iOS 18.0 and Maplibre 6.17.1 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
What do you have set as glyphs URL? Fonts need to be made available in a MapLibre font pbf file e.g. using https://github.com/maplibre/font-maker |
Beta Was this translation helpful? Give feedback.
-
That glyphs URL is where I have Noto Sans Regular, Italic, and Medium. I was under the impression that a layer that I add to an existing style could use a client-side font that ships with iOS? Perhaps the original style glyphs URL is overriding the client-side font declaration? |
Beta Was this translation helpful? Give feedback.
At this moment, that only applies to CJK fonts.
In the near future that may change though.