TextStyle

public struct TextStyle

Represents the style used to display safety locations markers.

Important

This stylization API is intended to be used for only the turn-by-turn navigation.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Initializes a new SafetyLocationStyle/TextStyle instance with the specified values.

    Declaration

    Swift

    public init(
        fontURL: String = Defaults.fontURL,
        color: UIColor = Defaults.color,
        size: Double = Defaults.size,
        offset: MarkerLabelOptions.TextOffset = Defaults.offset,
        anchoring: TextAnchoring = Defaults.anchoring
    )

    Parameters

    fontURL

    The font of the speed limit text on the marker. Default font is Notosans-Condensed.

    color

    Text color. Default color is black.

    size

    Text size (in point units).

    offset

    Double describing the offset that will be used to position the label in the TomTomSDKMapDisplay/Marker. Depending on the anchoring, the point of the label that is anchored varies: - If anchoring is left, the anchor point is the baseline-leftmost pixel of the label. - If anchoring is center, the anchor point is the baseline-center pixel of the label. - If anchoring is right, the anchor point is the baseline-rightmost pixel of the label.

       Defaults:
       For x axis, value is 15.5.
       For y axis, value is 40.0.
    
    anchoring

    TomTomSDKMapsDisplay/TextAnchoringdetermining how the label is positioned in the TomTomSDKMapDisplay/Marker.

  • Provides default values for TextStyle properties.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum Defaults
  • The font of the speed limit text on the marker. Default font is Notosans-Condensed.

    Declaration

    Swift

    public let fontURL: String
  • Text color. Default color is black.

    Declaration

    Swift

    public var color: UIColor
  • Text size (in point units).

    Declaration

    Swift

    public var size: Double
  • Describing the offset that will be used to position the label in the TomTomSDKMapDisplay/Marker. Depending on the anchoring, the point of the label that is anchored varies:

    • If anchoring is left, the anchor point is the baseline-leftmost pixel of the label.
    • If anchoring is center, the anchor point is the baseline-center pixel of the label.
    • If anchoring is right, the anchor point is the baseline-rightmost pixel of the label.

    Defaults: For x axis, value is 15.5. For y axis, value is 40.0.

    Declaration

    Swift

    public var offset: MarkerLabelOptions.TextOffset
  • The anchoring that will be used to position the speed limit text. Default value is center.

    Declaration

    Swift

    public var anchoring: TextAnchoring