-
Notifications
You must be signed in to change notification settings - Fork 0
/
font.h
54 lines (44 loc) · 1 KB
/
font.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright (C) 2019 Edward LEI <edward_lei72@hotmail.com>
*
* The code is licensed under the MIT license
*/
#ifndef _FONT_H_
#define _FONT_H_
#include "type.h"
/*
* Load freetype2 fonts
* sfnt - single width font
* dfnt - double width font
* sbfnt - single width font (bold)
* dbfnt - double width font (bold)
* h - font height in pixels
*
* Return: 0 - success
* 1 - failed
*/
int ftLoad(char *sfnt, char *dfnt, char *sbfnt, char *dbfnt, int h);
/*
* Free the font resource
*/
void ftFree();
/*
* Return: single cell height in pixels
*/
int ftH();
/*
* Return: single cell width in pixels
*/
int ftW();
/*
* Draw a character on the framebuffter
* r - character start row number
* c - character start column number
* ch - character to be put in framebuffter
* dw - double width character?
* b - bold?
* fg - font foreground color
* bg - font background color
*/
void ftCh2FB(int r, int c, u16_t ch, int dw, int b, fb32_t fg, fb32_t bg);
#endif