Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Text drawing in embedded system

Text drawing in embedded system

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshardwarejson
3 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    A_Fa
    wrote on last edited by
    #1

    Hi. I want to develop in an embedded system. It's OS dos not support any graphic API and functions except SetPixel for developer. I need to use some standard font for text drawing. If you have any idea to do that, please share with me. Thanks very much.

    O 1 Reply Last reply
    0
    • A A_Fa

      Hi. I want to develop in an embedded system. It's OS dos not support any graphic API and functions except SetPixel for developer. I need to use some standard font for text drawing. If you have any idea to do that, please share with me. Thanks very much.

      O Offline
      O Offline
      Orjan Westin
      wrote on last edited by
      #2

      You'll have to write your own routines for drawing text. The way this was done back in the day was to create a fixed-size font (usually consisting of 8x8 monochrome pixels, so each character would take 8 bytes to describe), and a simple look-up algorithm (in this case something like "base address of font + character code * 8). If you have to work pixel by pixel, I'd start with writing a routine to draw a row of 8 pixels, and use that to draw the whole character. There are some classic old fonts to look at here: http://damieng.com/blog/2011/02/20/typography-in-8-bits-system-fonts[^] You'd have to convert them to your own format, but that's reasonably trivial. If you take the first (PET), resize it so that there's one real pixel per used pixel, and save the image as a monochrome (2-bit) bitmap, you can read it out from there.

      A 1 Reply Last reply
      0
      • O Orjan Westin

        You'll have to write your own routines for drawing text. The way this was done back in the day was to create a fixed-size font (usually consisting of 8x8 monochrome pixels, so each character would take 8 bytes to describe), and a simple look-up algorithm (in this case something like "base address of font + character code * 8). If you have to work pixel by pixel, I'd start with writing a routine to draw a row of 8 pixels, and use that to draw the whole character. There are some classic old fonts to look at here: http://damieng.com/blog/2011/02/20/typography-in-8-bits-system-fonts[^] You'd have to convert them to your own format, but that's reasonably trivial. If you take the first (PET), resize it so that there's one real pixel per used pixel, and save the image as a monochrome (2-bit) bitmap, you can read it out from there.

        A Offline
        A Offline
        A_Fa
        wrote on last edited by
        #3

        Thanks a'lot for your attention and your nice response.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups