Sharpie
Search Results for

    Show / Hide Table of Contents
    • Sharpie
      • Canvas
      • Canvas.CheckGlyphStyle
      • Canvas.FillStyle
      • Canvas.GlyphSize
      • Canvas.GradientGlyphStyle
      • Canvas.LineStyle
      • Canvas.Orientation
      • Canvas.ShadeGlyphStyle
      • Canvas.TriangleGlyphStyle
      • CaretMode
      • ClearStrategy
      • ColorManager
      • ColorMixture
      • ColorMode
      • ControlCharacter
      • CursesException
      • CursesInitializationException
      • CursesOperationException
      • CursesSynchronizationException
      • DelegateEvent
      • Event
      • EventPump
      • EventType
      • Key
      • KeyEvent
      • KeySequenceResolver
      • ModifierKey
      • MouseActionEvent
      • MouseButton
      • MouseButtonState
      • MouseMoveEvent
      • Pad
      • ReplaceStrategy
      • ResolveEscapeSequenceFunc
      • Screen
      • SoftLabelKeyAlignment
      • SoftLabelKeyManager
      • SoftLabelKeyMode
      • StandardColor
      • StartEvent
      • StopEvent
      • Style
      • StyledText
      • SubPad
      • SubWindow
      • Surface
      • Terminal
      • TerminalOptions
      • TerminalResizeEvent
      • TerminalSurface
      • VideoAttribute
      • Window
    • Sharpie.Abstractions
      • IAsciiFont
      • IColorManager
      • ICursesBackend
      • ICursesBackend.ripoffline_callback
      • IDrawSurface
      • IDrawable
      • IEventPump
      • IInterval
      • IPad
      • IScreen
      • ISoftLabelKeyManager
      • ISubPad
      • ISubWindow
      • ISurface
      • ITerminal
      • ITerminalSurface
      • IWindow
    • Sharpie.Backend
      • ComplexChar
      • CursesBackend
      • CursesBackendFlavor
      • CursesBackendType
      • CursesCharEvent
      • CursesEvent
      • CursesKeyEvent
      • CursesMouseEvent
      • CursesMouseState
      • CursesResizeEvent
      • NCursesKeyCode
      • PdCursesKeyCode
    • Sharpie.Font
      • AsciiFont
      • AsciiFontLayout
      • DosCp866AsciiFont
      • FigletFont

    Class AsciiFont

    Defines the traits implemented by ASCII font providers.

    Inheritance
    object
    AsciiFont
    DosCp866AsciiFont
    FigletFont
    Implements
    IAsciiFont
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Sharpie.Font
    Assembly: sharpie.dll
    Syntax
    [PublicAPI]
    public abstract class AsciiFont : IAsciiFont

    Constructors

    AsciiFont(string, int, int, AsciiFontLayout)

    Creates a new instance of this class.

    Declaration
    protected AsciiFont(string name, int height, int baseline, AsciiFontLayout layout)
    Parameters
    Type Name Description
    string name

    The name of the font.

    int height

    The height of the font.

    int baseline

    The font's baseline.

    AsciiFontLayout layout

    The font's layout.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if name is null of empty.

    ArgumentOutOfRangeException

    Thrown if height is less than one.

    Properties

    Baseline

    The font baseline.

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

    Height

    The font height.

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

    Layout

    The font's name.

    Declaration
    public AsciiFontLayout Layout { get; }
    Property Value
    Type Description
    AsciiFontLayout

    Name

    The font's name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Methods

    GetGlyph(Rune, Style)

    Tries to get a glyph for a given char.

    Declaration
    public virtual IDrawable GetGlyph(Rune @char, Style style)
    Parameters
    Type Name Description
    Rune char

    The character.

    Style style

    The style to apply to the glyph.

    Returns
    Type Description
    IDrawable

    The output glyph, if found. Otherwise, the font will substitute the glyph with something else.

    GetGlyphs(ReadOnlySpan<Rune>, Style)

    Tries to get a drawing for a given list of chars.

    Declaration
    public abstract IDrawable GetGlyphs(ReadOnlySpan<Rune> chars, Style style)
    Parameters
    Type Name Description
    ReadOnlySpan<Rune> chars

    The characters.

    Style style

    The style to apply to the glyphs.

    Returns
    Type Description
    IDrawable

    The output glyphs.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if chars is empty.

    GetGlyphs(string, Style)

    Tries to get a drawing for a given text.

    Declaration
    public virtual IDrawable GetGlyphs(string text, Style style)
    Parameters
    Type Name Description
    string text

    The text.

    Style style

    The style to apply to the glyphs.

    Returns
    Type Description
    IDrawable

    The output glyphs.

    Exceptions
    Type Condition
    ArgumentException

    Thrown if text is empty.

    HasGlyph(Rune)

    Checks if the font contains a given glyph.

    Declaration
    public abstract bool HasGlyph(Rune @char)
    Parameters
    Type Name Description
    Rune char

    The character.

    Returns
    Type Description
    bool

    true if the font contains the given glyph; false otherwise.

    Implements

    IAsciiFont
    In this article
    Back to top Generated by DocFX