🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    The hight of character

    Scheduled Pinned Locked Moved Units
    m5paper
    3 Posts 3 Posters 6.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Powersoft
      last edited by

      Hello,

      I use this font, and now I wont to know what is hight of a charchter?

      canvas1.loadFont("/fonts/GenSenRounded-R.ttf", SD);
      canvas1.createRender(60);
      canvas1.setTextSize(60);

      I use the above commands.
      Any sugestion?

      Cheers,

      Jan

      K 1 Reply Last reply Reply Quote 0
      • K Offline
        ksprayberry @Powersoft
        last edited by

        @powersoft I kind of ran into this the other day. I found a font I liked online, but was not sure how to gauge the height of the font and the placement of the text on the screen. I ended up using trial and error which kind of sucked due to the lengthy compile and upload process.

        1 Reply Last reply Reply Quote 0
        • M Offline
          murraypaul
          last edited by

          This is available in the TFT_eSPI base class to canvas, but is not exposed to us.
          The following seems to work:

          int height = ((TFT_eSPI&)Canvas).fontHeight();
          
          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post