• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.Fonts
      • ColorFontSupport
      • Font
      • FontCollection
      • FontCollectionExtensions
      • FontDescription
      • FontException
      • FontFamily
      • FontFamilyNotFoundException
      • FontMetrics
      • FontRectangle
      • FontStyle
      • Glyph
      • GlyphBounds
      • GlyphColor
      • GlyphLayoutMode
      • GlyphMetrics
      • GlyphMissingException
      • GlyphRendererParameters
      • GlyphType
      • HintingMode
      • HorizontalAlignment
      • HorizontalMetrics
      • IColorGlyphRenderer
      • IFontCollection
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • IMetricsHeader
      • IReadOnlyFontCollection
      • IReadOnlySystemFontCollection
      • InvalidFontFileException
      • InvalidFontTableException
      • KerningMode
      • LayoutMode
      • LayoutModeExtensions
      • MissingFontTableException
      • SystemFonts
      • TextAlignment
      • TextAttributes
      • TextDecorations
      • TextDirection
      • TextJustification
      • TextMeasurer
      • TextOptions
      • TextRenderer
      • TextRun
      • VerticalAlignment
      • VerticalMetrics
      • WordBreaking
    • SixLabors.Fonts.Tables.AdvancedTypographic
      • FeatureTags
      • GlyphClassDef
      • Tag
    • SixLabors.Fonts.Tables.TrueType
      • TrueTypeGlyphMetrics
    • SixLabors.Fonts.Unicode
      • ArabicJoiningClass
      • ArabicJoiningGroup
      • ArabicJoiningType
      • BidiCharacterType
      • BidiClass
      • BidiPairedBracketType
      • CodePoint
      • GraphemeClusterClass
      • IndicPositionalCategory
      • IndicSyllabicCategory
      • LineBreakClass
      • MemoryExtensions
      • ScriptClass
      • SpanCodePointEnumerator
      • SpanGraphemeEnumerator
      • VerticalOrientationType
    • SixLabors.Fonts.WellKnownIds
      • KnownNameIds

    Struct CodePoint

    Represents a Unicode value ([ U+0000..U+10FFFF ], inclusive).

    Implements
    IComparable
    IComparable<CodePoint>
    IEquatable<CodePoint>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: SixLabors.Fonts.Unicode
    Assembly: SixLabors.Fonts.dll
    Syntax
    public readonly struct CodePoint : IComparable, IComparable<CodePoint>, IEquatable<CodePoint>
    Remarks

    This type's constructors and conversion operators validate the input, so consumers can call the APIs assuming that the underlying CodePoint instance is well-formed.

    Constructors

    | Edit this page View Source

    CodePoint(char)

    Initializes a new instance of the CodePoint struct.

    Declaration
    public CodePoint(char value)
    Parameters
    Type Name Description
    char value

    The char representing the UTF-16 code unit

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If value represents a UTF-16 surrogate code point U+D800..U+DFFF, inclusive.

    | Edit this page View Source

    CodePoint(char, char)

    Initializes a new instance of the CodePoint struct.

    Declaration
    public CodePoint(char highSurrogate, char lowSurrogate)
    Parameters
    Type Name Description
    char highSurrogate

    A char representing a UTF-16 high surrogate code unit.

    char lowSurrogate

    A char representing a UTF-16 low surrogate code unit.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If highSurrogate does not represent a UTF-16 high surrogate code unit or lowSurrogate does not represent a UTF-16 low surrogate code unit.

    | Edit this page View Source

    CodePoint(int)

    Initializes a new instance of the CodePoint struct.

    Declaration
    public CodePoint(int value)
    Parameters
    Type Name Description
    int value

    The value to create the codepoint.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If value does not represent a value Unicode scalar value.

    | Edit this page View Source

    CodePoint(uint)

    Initializes a new instance of the CodePoint struct.

    Declaration
    public CodePoint(uint value)
    Parameters
    Type Name Description
    uint value

    The value to create the codepoint.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    If value does not represent a value Unicode scalar value.

    Properties

    | Edit this page View Source

    IsAscii

    Gets a value indicating whether this value is ASCII ([ U+0000..U+007F ]) and therefore representable by a single UTF-8 code unit.

    Declaration
    public bool IsAscii { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsBmp

    Gets a value indicating whether this value is within the BMP ([ U+0000..U+FFFF ]) and therefore representable by a single UTF-16 code unit.

    Declaration
    public bool IsBmp { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Plane

    Gets the Unicode plane (0 to 16, inclusive) which contains this scalar.

    Declaration
    public int Plane { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    ReplacementChar

    Gets a CodePoint instance that represents the Unicode replacement character U+FFFD.

    Declaration
    public static CodePoint ReplacementChar { get; }
    Property Value
    Type Description
    CodePoint
    | Edit this page View Source

    Utf16SequenceLength

    Gets the length in code units (char) of the UTF-16 sequence required to represent this scalar value.

    Declaration
    public int Utf16SequenceLength { get; }
    Property Value
    Type Description
    int
    Remarks

    The return value will be 1 or 2.

    | Edit this page View Source

    Utf8SequenceLength

    Gets the length in code units of the UTF-8 sequence required to represent this scalar value.

    Declaration
    public int Utf8SequenceLength { get; }
    Property Value
    Type Description
    int
    Remarks

    The return value will be 1 through 4, inclusive.

    | Edit this page View Source

    Value

    Gets the Unicode value as an integer.

    Declaration
    public int Value { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    CompareTo(CodePoint)

    Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

    Declaration
    public int CompareTo(CodePoint other)
    Parameters
    Type Name Description
    CodePoint other

    An object to compare with this instance.

    Returns
    Type Description
    int

    A value that indicates the relative order of the objects being compared. The return value has these meanings:

    Value Meaning
    Less than zero This instance precedes other in the sort order.
    Zero This instance occurs in the same position in the sort order as other.
    Greater than zero This instance follows other in the sort order.
    | Edit this page View Source

    Equals(CodePoint)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(CodePoint other)
    Parameters
    Type Name Description
    CodePoint other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object?)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    GetBidiClass(CodePoint)

    Gets the BidiClass for the given codepoint.

    Declaration
    public static BidiClass GetBidiClass(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    BidiClass

    The BidiClass.

    | Edit this page View Source

    GetCodePointCount(ReadOnlySpan<char>)

    Returns the number of codepoints in a given string buffer.

    Declaration
    public static int GetCodePointCount(ReadOnlySpan<char> source)
    Parameters
    Type Name Description
    ReadOnlySpan<char> source

    The source buffer to parse.

    Returns
    Type Description
    int

    The int count.

    | Edit this page View Source

    GetGeneralCategory(CodePoint)

    Gets the UnicodeCategory for the given codepoint.

    Declaration
    public static UnicodeCategory GetGeneralCategory(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    UnicodeCategory

    The UnicodeCategory.

    | Edit this page View Source

    GetGraphemeClusterClass(CodePoint)

    Gets the GraphemeClusterClass for the given codepoint.

    Declaration
    public static GraphemeClusterClass GetGraphemeClusterClass(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    GraphemeClusterClass

    The GraphemeClusterClass.

    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    GetLineBreakClass(CodePoint)

    Gets the LineBreakClass for the given codepoint.

    Declaration
    public static LineBreakClass GetLineBreakClass(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    LineBreakClass

    The LineBreakClass.

    | Edit this page View Source

    GetVerticalOrientationType(CodePoint)

    Gets the VerticalOrientationType for the given codepoint.

    Declaration
    public static VerticalOrientationType GetVerticalOrientationType(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    VerticalOrientationType

    The VerticalOrientationType.

    | Edit this page View Source

    IsControl(CodePoint)

    Gets a value indicating whether the given codepoint is a control character.

    Declaration
    public static bool IsControl(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a control character; otherwise, false

    | Edit this page View Source

    IsDigit(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a decimal digit.

    Declaration
    public static bool IsDigit(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a decimal digit; otherwise, false

    | Edit this page View Source

    IsLetter(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a letter.

    Declaration
    public static bool IsLetter(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a letter; otherwise, false

    | Edit this page View Source

    IsLetterOrDigit(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a letter or decimal digit.

    Declaration
    public static bool IsLetterOrDigit(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a letter or decimal digit; otherwise, false

    | Edit this page View Source

    IsLower(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a lowercase letter.

    Declaration
    public static bool IsLower(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a lowercase letter; otherwise, false

    | Edit this page View Source

    IsMark(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a mark.

    Declaration
    public static bool IsMark(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a symbol; otherwise, false

    | Edit this page View Source

    IsNewLine(CodePoint)

    Gets a value indicating whether the given codepoint is a new line indicator.

    Declaration
    public static bool IsNewLine(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a new line indicator; otherwise, false

    | Edit this page View Source

    IsNonBreakingSpace(CodePoint)

    Gets a value indicating whether the given codepoint is a non-breaking space.

    Declaration
    public static bool IsNonBreakingSpace(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a non-breaking space character; otherwise, false

    | Edit this page View Source

    IsNumber(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a number.

    Declaration
    public static bool IsNumber(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a number; otherwise, false

    | Edit this page View Source

    IsPunctuation(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as punctuation.

    Declaration
    public static bool IsPunctuation(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is punctuation; otherwise, false

    | Edit this page View Source

    IsSeparator(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a separator.

    Declaration
    public static bool IsSeparator(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a separator; otherwise, false

    | Edit this page View Source

    IsSymbol(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as a symbol.

    Declaration
    public static bool IsSymbol(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a symbol; otherwise, false

    | Edit this page View Source

    IsTabulation(CodePoint)

    Gets a value indicating whether the given codepoint is a tabulation indicator.

    Declaration
    public static bool IsTabulation(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a tabulation indicator; otherwise, false

    | Edit this page View Source

    IsUpper(CodePoint)

    Returns a value that indicates whether the specified codepoint is categorized as an uppercase letter.

    Declaration
    public static bool IsUpper(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a uppercase letter; otherwise, false

    | Edit this page View Source

    IsValid(int)

    Returns true if value is a valid Unicode code point, i.e., is in [ U+0000..U+10FFFF ], inclusive.

    Declaration
    public static bool IsValid(int value)
    Parameters
    Type Name Description
    int value

    The value to evaluate.

    Returns
    Type Description
    bool

    true if value represents a valid codepoint; otherwise, false

    | Edit this page View Source

    IsValid(uint)

    Returns true if value is a valid Unicode code point, i.e., is in [ U+0000..U+10FFFF ], inclusive.

    Declaration
    public static bool IsValid(uint value)
    Parameters
    Type Name Description
    uint value

    The value to evaluate.

    Returns
    Type Description
    bool

    true if value represents a valid codepoint; otherwise, false

    | Edit this page View Source

    IsVariationSelector(CodePoint)

    Gets a value indicating whether the given codepoint is a variation selector. https://en.wikipedia.org/wiki/Variation_Selectors_%28Unicode_block%29

    Declaration
    public static bool IsVariationSelector(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a variation selector character; otherwise, false

    | Edit this page View Source

    IsWhiteSpace(CodePoint)

    Gets a value indicating whether the given codepoint is white space.

    Declaration
    public static bool IsWhiteSpace(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a whitespace character; otherwise, false

    | Edit this page View Source

    IsZeroWidthJoiner(CodePoint)

    Gets a value indicating whether the given codepoint is a zero-width-joiner.

    Declaration
    public static bool IsZeroWidthJoiner(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a zero-width-joiner character; otherwise, false

    | Edit this page View Source

    IsZeroWidthNonJoiner(CodePoint)

    Gets a value indicating whether the given codepoint is a zero-width-non-joiner.

    Declaration
    public static bool IsZeroWidthNonJoiner(CodePoint codePoint)
    Parameters
    Type Name Description
    CodePoint codePoint

    The codepoint to evaluate.

    Returns
    Type Description
    bool

    true if codePoint is a zero-width-non-joiner character; otherwise, false

    | Edit this page View Source

    ToString()

    Returns the fully qualified type name of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The fully qualified type name.

    Overrides
    ValueType.ToString()
    | Edit this page View Source

    TryGetBidiMirror(CodePoint, out CodePoint)

    Gets the codepoint representing the bidi mirror for this instance. http://www.unicode.org/reports/tr44/#Bidi_Mirrored

    Declaration
    public static bool TryGetBidiMirror(CodePoint codePoint, out CodePoint mirror)
    Parameters
    Type Name Description
    CodePoint codePoint

    The code point to be mapped.

    CodePoint mirror

    When this method returns, contains the codepoint representing the bidi mirror for this instance; otherwise, the default value for the type of the codePoint parameter. This parameter is passed uninitialized. .

    Returns
    Type Description
    bool

    true if this instance has a mirror; otherwise, false

    | Edit this page View Source

    TryGetVerticalMirror(CodePoint, out CodePoint)

    Gets the codepoint representing the vertical mirror for this instance. https://www.unicode.org/reports/tr50/#vertical_alternates

    Declaration
    public static bool TryGetVerticalMirror(CodePoint codePoint, out CodePoint mirror)
    Parameters
    Type Name Description
    CodePoint codePoint

    The code point to be mapped.

    CodePoint mirror

    When this method returns, contains the codepoint representing the vertical mirror for this instance; otherwise, the default value for the type of the codePoint parameter. This parameter is passed uninitialized. .

    Returns
    Type Description
    bool

    true if this instance has a mirror; otherwise, false

    Operators

    | Edit this page View Source

    operator ==(CodePoint, CodePoint)

    Declaration
    public static bool operator ==(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool
    | Edit this page View Source

    explicit operator CodePoint(char)

    Declaration
    public static explicit operator CodePoint(char ch)
    Parameters
    Type Name Description
    char ch
    Returns
    Type Description
    CodePoint
    | Edit this page View Source

    explicit operator CodePoint(int)

    Declaration
    public static explicit operator CodePoint(int value)
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    CodePoint
    | Edit this page View Source

    explicit operator CodePoint(uint)

    Declaration
    public static explicit operator CodePoint(uint value)
    Parameters
    Type Name Description
    uint value
    Returns
    Type Description
    CodePoint
    | Edit this page View Source

    operator >(CodePoint, CodePoint)

    Declaration
    public static bool operator >(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator >=(CodePoint, CodePoint)

    Declaration
    public static bool operator >=(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator !=(CodePoint, CodePoint)

    Declaration
    public static bool operator !=(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator <(CodePoint, CodePoint)

    Declaration
    public static bool operator <(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool
    | Edit this page View Source

    operator <=(CodePoint, CodePoint)

    Declaration
    public static bool operator <=(CodePoint left, CodePoint right)
    Parameters
    Type Name Description
    CodePoint left
    CodePoint right
    Returns
    Type Description
    bool

    Implements

    IComparable
    IComparable<T>
    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX