Class FontSource
Identifies a font file that Mapsui should load and use when rendering text.
The font is located via a URI using one of the supported schemes:
embedded://, file://, http://, or https://.
Assign to FontSource to override the system font with a custom typeface.
Inherited Members
Namespace: Mapsui.Styles
Assembly: Mapsui.dll
Syntax
public class FontSource
Properties
| Edit this page View SourceSource
The URI of the font file. Must use one of the supported schemes:
embedded://, file://, http://, or https://.
Assigning an unsupported scheme throws ArgumentException immediately.
Declaration
public required string Source { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
SourceToSourceId
Registry that maps each unique font source URI to a stable GUID-based identifier. The identifier is used as the cache key in FontSourceCache.
Declaration
public static ConcurrentDictionary<string, string> SourceToSourceId { get; }
Property Value
| Type | Description |
|---|---|
| ConcurrentDictionary<string, string> |
Methods
| Edit this page View SourceEquals(FontSource)
Declaration
protected bool Equals(FontSource other)
Parameters
| Type | Name | Description |
|---|---|---|
| FontSource | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Operators
| Edit this page View Sourceimplicit operator FontSource(string)
Allows a string to be used directly where a FontSource is expected.
Declaration
public static implicit operator FontSource(string source)
Parameters
| Type | Name | Description |
|---|---|---|
| string | source |
Returns
| Type | Description |
|---|---|
| FontSource |