ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
Macros | Functions | Variables
font.c File Reference

Font display for ili9341 driver Displays fonts generated by bdffont2c BDF to C code converter BDF = Glyph Bitmap Distribution Format The code handles fixed, proportional and bounding box format fonts. More...

#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "display/ili9341.h"
#include "display/font.h"
#include "fonts.h"

Go to the source code of this file.

Macros

#define MEMSPACE_FONT   MEMSPACE
 save fonts in flash More...
 

Functions

int font_max ()
 
int font_H (int font)
 Get font height used for line to line spacing. More...
 
int font_W (int font)
 Get font Width used for character to character spacing. More...
 
int font_attr (window *win, int c, _fontc *f)
 Get font attributes for a font. More...
 
void tft_drawChar (window *win, uint8_t c)
 Display a character and optionally wrap the graphic cursor. More...
 

Variables

_fontallfonts []
 Include the Generated Font table The generated tables always include Font specifications: width, height, offsets, font type, etc Font information: name, copyright, style information Note: FONSPECS and FONTINFO defines controls actual usage. We can also overide FONTSPECS here or in the Makefile for testing. More...
 

Detailed Description

Font display for ili9341 driver Displays fonts generated by bdffont2c BDF to C code converter BDF = Glyph Bitmap Distribution Format The code handles fixed, proportional and bounding box format fonts.

See also
http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format
Copyright © 2015 Mike Gore, GPL License
You are free to use this code under the terms of GPL
Please retain a copy of this notice in any code you use it in.

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file font.c.

Macro Definition Documentation

#define MEMSPACE_FONT   MEMSPACE

save fonts in flash

Definition at line 42 of file font.c.

Function Documentation

int font_attr ( window win,
int  c,
_fontc f 
)

Get font attributes for a font.

Parameters
[in]*winWindow Structure
[in]ccharacter
[in]*ffont structure
Returns
font number

Definition at line 94 of file font.c.

Referenced by tft_cleareol(), tft_clearline(), tft_drawChar(), tft_get_font_height(), and tft_putch().

int font_H ( int  font)

Get font height used for line to line spacing.

Parameters
[in]fontfont number
Returns
Height in pixels

Definition at line 70 of file font.c.

Referenced by test_types(), and tft_set_textpos().

int font_max ( void  )

Definition at line 59 of file font.c.

Referenced by tft_set_font().

int font_W ( int  font)

Get font Width used for character to character spacing.

Parameters
[in]fontfont number
Returns
Width in pixels

Definition at line 80 of file font.c.

Referenced by tft_set_textpos().

void tft_drawChar ( window win,
uint8_t  c 
)

Display a character and optionally wrap the graphic cursor.

See also
tft_putch for main output function Does not handle control characters
Parameters
[in]*winWindow Structure of active window
[in]ccharacter
Returns
void TODO: To make proportional fonts render even better we should reduce the font gap so that all of the active pixels between two fonts come no nearer then a defined value. Example: consider the characters "Td", the 'd' can actually be part way INSIDE the T

Definition at line 200 of file font.c.

Referenced by tft_putch().

Variable Documentation

_font* allfonts[]

Include the Generated Font table The generated tables always include Font specifications: width, height, offsets, font type, etc Font information: name, copyright, style information Note: FONSPECS and FONTINFO defines controls actual usage. We can also overide FONTSPECS here or in the Makefile for testing.

Definition at line 14699 of file fonts.h.

Referenced by main().