Mercurial > mplayer.hg
annotate gui/skin/font.h @ 34860:4a7962b0f3d4
Make array const and more compact.
author | reimar |
---|---|
date | Mon, 21 May 2012 19:17:55 +0000 |
parents | 922771be85f6 |
children | e27855a45128 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
26029 | 19 #ifndef MPLAYER_GUI_FONT_H |
20 #define MPLAYER_GUI_FONT_H | |
23077 | 21 |
32869 | 22 #include "gui/app.h" |
33046 | 23 #include "gui/util/bitmap.h" |
23077 | 24 |
32734
cc58a1e919d9
Allow character in the font description file to be in UTF-8.
ib
parents:
28051
diff
changeset
|
25 #define ASCII_CHRS 128 // number of ASCII characters |
cc58a1e919d9
Allow character in the font description file to be in UTF-8.
ib
parents:
28051
diff
changeset
|
26 #define EXTRA_CHRS 128 // (arbitrary) number of non-ASCII characters |
32835
19cc523b8e15
Enlarge uchar buffer, because GLib implements 31-bit UTF-8,
ib
parents:
32787
diff
changeset
|
27 #define UTF8LENGTH 4 // length of an UTF-8 encoding according to RFC 3629 |
32734
cc58a1e919d9
Allow character in the font description file to be in UTF-8.
ib
parents:
28051
diff
changeset
|
28 |
32786 | 29 #define MAX_FONT_NAME 128 |
23077 | 30 |
32869 | 31 typedef struct { |
32 int x, y; // location | |
33 int sx, sy; // size | |
23077 | 34 } fntChar; |
35 | |
32869 | 36 typedef struct { |
37 fntChar Fnt[ASCII_CHRS + EXTRA_CHRS]; | |
38 unsigned char nonASCIIidx[EXTRA_CHRS][UTF8LENGTH]; | |
33555 | 39 guiImage Bitmap; |
32869 | 40 char name[MAX_FONT_NAME]; |
23077 | 41 } bmpFont; |
42 | |
32948 | 43 int fntFindID(char *name); |
32869 | 44 void fntFreeFont(void); |
32948 | 45 int fntRead(char *path, char *fname); |
33971 | 46 guiImage *fntTextRender(wItem *item, int px, char *txt); |
32948 | 47 int fntTextWidth(int id, char *str); |
23077 | 48 |
26029 | 49 #endif /* MPLAYER_GUI_FONT_H */ |