Question: In C, write a function that takes arguments (char **display, char *s, FILE fp). display is the display buffer, s is the string to be

In C, write a function that takes arguments (char **display, char *s, FILE fp). display is the display buffer, s is the string to be shown on the line and fp points to an opened font file. It retrieves the font information for up to 8 characters in s from fp and updates the display. It returns the number of bytes processed (between 0 and 8). Also provide a function to correctly display the display buffer-this will be called "void print_display(char **display)"

The font file you will be using is font8x8.dat, which can be generated by running generate-fontfile (another c file code below). This font displays each character as an 8x8 dot matrix. A row of 8 pixels can be stored in a byte, with each pixel stored in a bit. If a bit is 0, the pixel has the background color. Otherwise, the pixel has the font color. The left most pixel in a row is stored in the right most bit, and the right most pixel in the left most bit. Since each dot matrix has eight rows, the entire 8x8 matrix can be stored in 8 bytes. The program uses ' ' and '*' as pixels to display a string on screen. If the string is long, it is displayed in multiple lines. A line displays up to NUM_CHAR_PER_LINE characters in the string. NUM_CHAR_PER_LINE is defined as 8 in the template file.

function is called "unsigned int str_display(char **display, char *s, FILE *fp)"

Output for input of "Hello"

In C, write a function that takes arguments (char **display, char *s,

partially complete main:

FILE fp). display is the display buffer, s is the string to

This is the link to the font file that is in generate-fontfile.

https://github.com/dhepper/font8x8/blob/master/font8x8_basic.h

This is the rest of the generate-fontfile file

be shown on the line and fp points to an opened font

k* k* k* k* k* k* k* k*

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!