Skip to content

Implement text drawing #7

Open
Open

Description

@coder543

dataplotlib needs to be able to draw text so it can draw labels on the axes, add a chart title, and do other important things. Ideally, the Draw trait would have two new methods: one to draw text at an arbitrary location, and one to modify the current font properties such as the size and font face being used. With SDL2, drawing text is actually fairly straightforward, but I'm not sure what the best approach is for finding the installed fonts on a given system in a crossplatform manner. We could definitely bundle a free font with dataplotlib as a default and as a fallback in case we can't find a particular requested font.

Activity

  1. added this to the Help Wanted milestone on Nov 22, 2017
  2. mmstick commented on Nov 22, 2017

    @mmstick

    I'd definitely recommend the free Fira fonts from Mozilla, which generally fits with applications begin written in Mozilla's Rust. As for finding fonts:

    Linux

    • $HOME/.local/share/fonts
    • $HOME/.fonts
    • /usr/share/fonts

    Windows

    • C:\Windows\Fonts

    Mac

    • /Library/Fonts/
    • $HOME/Library/Fonts/
    • /Network/Library/Fonts/
    • /System/Library/Fonts/

    You could easily create an iterator that just chains these directories together, depending on the platform.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions