File: main-c.c

package info (click to toggle)
libucimf 2.3.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,912 kB
  • ctags: 708
  • sloc: sh: 10,568; cpp: 3,769; ansic: 789; makefile: 63
file content (34 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (5)
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
#include "font.h"
#include <stdio.h>

int main()
{
	call_Font_setInfo("細明體", 16, 0 ); // 字型取自 fc-list 的列表
	call_Font_showInfo();

	u16 code = 0x4e2d; // 0x4e2d => "中"
	struct_Font_Glyph *glyph = call_Font_getGlyph(code);

	//cout << "glyph->pitch: " << glyph->pitch << endl;
	//cout << "glyph->width: " << glyph->width << endl;
	//cout << "glyph->height: " << glyph->height << endl;
	//cout << "glyph->left: " << glyph->left << endl;
	//cout << "glyph->top: " << glyph->top << endl;

	int x,y;
	for ( y = glyph->height; y > 0 ; y-- )
	{
		for ( x = 0; x < glyph->width ; x++ )
		{
			if ( glyph->pixmap[ (glyph->height - y) * glyph->pitch + x ] ) {
				printf( "O" );
			}
			else {
				printf( "_" );
			}
		}
		printf( "\n" );
	}

	return 0;
}