1 /*
2  * Stub implementation of the TTF calls that would otherwise pull in
3  * a dependency to freetype et al. Used when TUI is built with
4  * TUI_RASTER_NO_TTF and defined as such in shmif/CMakeLists.txt
5  */
6 
7 #include <inttypes.h>
8 #include "../../arcan_shmif.h"
9 #include "../../arcan_tui.h"
10 
11 #define SHMIF_TTF
12 #include "arcan_ttf.h"
13 
TTF_ProbeFont(TTF_Font * font,size_t * dw,size_t * dh)14 void TTF_ProbeFont(TTF_Font* font, size_t* dw, size_t* dh)
15 {
16 	*dw = 0;
17 	*dh = 0;
18 }
19 
20 /* open font using a preexisting file descriptor, takes ownership of fd */
TTF_OpenFontFD(int fd,int ptsize,uint16_t hdpi,uint16_t vdpi)21 TTF_Font* TTF_OpenFontFD(int fd, int ptsize, uint16_t hdpi, uint16_t vdpi)
22 {
23 	close(fd);
24 	return NULL;
25 }
26 
TTF_CloseFont(TTF_Font * font)27 void TTF_CloseFont(TTF_Font* font)
28 {
29 }
30 
TTF_FindGlyph(TTF_Font ** fonts,int n,uint32_t ch,int want,bool by_ind)31 TTF_Font* TTF_FindGlyph(TTF_Font** fonts, int n, uint32_t ch, int want, bool by_ind)
32 {
33 	return NULL;
34 }
35 
TTF_RenderUNICODEglyph(PIXEL * dst,size_t width,size_t height,int stride,TTF_Font ** font,size_t n,uint32_t ch,unsigned * xstart,uint8_t fg[4],uint8_t bg[4],bool usebg,bool use_kerning,int style,int * advance,unsigned * prev_index)36 bool TTF_RenderUNICODEglyph(PIXEL* dst,
37 	size_t width, size_t height, int stride, TTF_Font** font, size_t n,
38 	uint32_t ch, unsigned* xstart, uint8_t fg[4], uint8_t bg[4],
39 	bool usebg, bool use_kerning, int style,
40 	int* advance, unsigned* prev_index)
41 {
42 	return false;
43 }
44 
TTF_SetFontHinting(TTF_Font * font,int hinting)45 void TTF_SetFontHinting(TTF_Font *font, int hinting)
46 {
47 }
48 
TTF_SetFontStyle(TTF_Font * font,int style)49 void TTF_SetFontStyle(TTF_Font *font, int style)
50 {
51 }
52 
TTF_FontStyle(TTF_Font * font,int style)53 void TTF_FontStyle(TTF_Font* font, int style)
54 {
55 }
56