Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:58:57+00:00 2026-06-05T21:58:57+00:00

My first question ever, so I’ll try to be as descriptive as possible. I

  • 0

My first question ever, so I’ll try to be as descriptive as possible.

I have a TFT display that I have connected to an embedded processor’s bus (64kb RAM, no OS obviously). I wrote a C++ class to set pixels on the display. My goal is to print letters. Each pixel of the letter only needs to be described by 1 bit: on or off. I imagined making a header file of the following format:

#ifndef ABC_H
#define ABC_H

namespace ABC{
    const unsigned int a[]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
}

#endif

The character above, which I have called “ABC::a”, represents a thin white box with a black box on top and bottom. I have a program that turns bmp files into a header file above. The array is 32 ints long, and each int is 32 bits (I will probably use uint32_t in the final draft, so don’t worry!). This effectively means that I’ve described one ASCII character as a 32×32 bmp. To print it at a specified (X,Y) coordinate, I would just need to do this:

void PrintChar(const int* c,X,Y){
    for(unsigned int y=0; y<32; y++)
        for(unsigned int x=0; x<32; x++)
            if(c[y] & 1<<x)
                SetPixel(x+X,y+Y); //SetPixel(x,y) lights up a pixel at coordinates (x,y) on the display
}

Question: What would be a good way to generate 32×32 bmps of ASCII characters, preferably not tediously by hand with paint.exe. Alternatively once, does someone have a better means to the end that I want (like skipping the middleman program somehow)? Alternatively twice, am I just being dumb and there’s a much better way to describe ASCII characters for my purposes?

Note: I realize using C++ for an embedded processor is a questionable practice (at least I think so) but that’s what I was instructed to do. /shrug

edit: Ignore the compression part! I’ll handle that on my own (unless you really want to share some ideas, then fire away!).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:58:59+00:00Added an answer on June 5, 2026 at 9:58 pm

    You can use any graphics library to draw characters to a buffer, and then construct your character data from the buffer.

    On Windows, the most obvious way would be to use GDI+ and ClearType, or you could take a look at Cairo. If you want full control over character rendering, I suggest using Freetype.

    Once you have a buffer containing the character, you might need to test individual pixesl whether they should be black or white (because graphics libraries might apply anti-alias). Alternatively, depending on how you draw the text and which font you use, it might not use anti-alias at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first ever question. I am developing a iPad app that allows
My first ever question here. Please excuse me, I have just entered into C++
Here's my HTML. Apologies for formatting - this is my first-ever question! <div id=Template>
First question here: it is a very short yet fundamental thing in Java that
First question from me; I'm currently fixing a graphing service that uses XSLFO to
First question ever asked at stackoverflow. So, problem is: Two accordion declarations on document.ready
This is probably the worst question I have ever posted on Stack Overflow but
Original Question: This is my first post ever. I'm trying to learn ios programming
this is my first time ever posting a question and I am kind of
First, iReport is the worst reporting tool I've ever used. Now to my question.....

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.