Skip to content

Support loading TrueType fonts for use in Canvas objects #808

Closed
@ajstarks

Description

Is your feature request related to a problem? Please describe:

it would be useful to apply an arbitrary font to Text objects rendered on the fyne Canvas

Is it possible to construct a solution with the existing API?

No.

Describe the solution you'd like to see:

Add a field to the fyne/canvas.Text object that points to font resource. The default value can be the sans-serif font used by the current theme.

type Text struct {
    Alignment fyne.TextAlign // The alignment of the text content

    Color     color.Color    // The main text draw colour
    Text      string         // The string content of this Text
    TextSize  int            // Size of the text - if the Canvas scale is 1.0 this will be equivalent to point size
    TextStyle fyne.TextStyle // The style of the text content
    TextFont string          // font name -- points to TTF file in a magic place?
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions