File: font.h

package info (click to toggle)
mtpaint 3.31-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,828 kB
  • ctags: 3,380
  • sloc: ansic: 35,565; sh: 738; makefile: 114; perl: 16
file content (45 lines) | stat: -rw-r--r-- 1,837 bytes parent folder | download
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
/*	font.h
	Copyright (C) 2007-2008 Mark Tyler

	This file is part of mtPaint.

	mtPaint 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.

	mtPaint 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 mtPaint in the file COPYING.
*/

#define TEXT_PASTE_NONE 0		// Not using text paste in the clipboard
#define TEXT_PASTE_GTK 1		// GTK+ text paste
#define TEXT_PASTE_FT 2			// FreeType text paste

#define MT_TEXT_SHRINK 1		// Shrink size to minimum area possible around text
#define MT_TEXT_MONO 2			// Force mono rendering
#define MT_TEXT_ROTATE_NN 4		// Use nearest neighbour rotation on bitmap fonts
#define MT_TEXT_OBLIQUE 8		// Apply Oblique matrix transformation to scalable fonts


unsigned char *mt_text_render(		// NULL return = failure, otherwise points to 8bpp memory chunk
		char	*text,		// Text to render
		int	characters,	// Characters to render (may be less if 0 is encountered first)
		char	*filename,	// Font file
		char	*encoding,	// Encoding of text, e.g. ASCII, UTF-8, UNICODE
		double	size,		// Scalable font size
		int	face_index,	// Usually 0, but maybe higher for bitmap fonts like *.FON
		double	angle,		// Rotation, anticlockwise
		int	flags,		// MT_TEXT_* flags
		int	*width,		// Resulting width of memory chunk allocated
		int	*height		// Resulting height of memory chunk allocated
		);

void pressed_mt_text();
void ft_render_text();			// FreeType equivalent of render_text()