summaryrefslogtreecommitdiff
path: root/src/defaultfont.h
blob: d1e3611be6a49de7bf0957cd8cb6a37df32f2fe5 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#ifndef _DEFAULTFONT_H_
#define _DEFAULTFONT_H_

# ifdef HAVE_X11_LOCALE_H
#  include <X11/Xlocale.h>
# else
#  include <locale.h>
# endif

#ifdef HAVE_NL_LANGINFO
# include <langinfo.h>
#endif


extern void eterm_default_font_locale(char ***fonts, char ***mfonts, char **mencoding, int *def_idx);

/*
 * List of encoding labels.
 * Note "encoding" is not "character set" nor "encoding method".
 *
 * In Eterm, "encoding" is implemented as a pair of "encoding method"
 * (implemented as ENC_METHOD in screen.h) and font specification,
 * i.e., defaultfont[] in this file.
 *
 * This type is used only in this file.
 */

enum enc_label {
  ENC_SJIS, ENC_EUCJ, ENC_GB, ENC_BIG5, ENC_EUCKR,
  ENC_ISO8859_1, ENC_ISO8859_2, ENC_ISO8859_3, ENC_ISO8859_4,
  ENC_ISO8859_5, ENC_ISO8859_6, ENC_ISO8859_7, ENC_ISO8859_8,
  ENC_ISO8859_9, ENC_ISO8859_10, ENC_ISO8859_11, ENC_ISO8859_12,
  ENC_ISO8859_13, ENC_ISO8859_14, ENC_ISO8859_15,
  ENC_KOI8R, ENC_KOI8U, ENC_UTF8,
  /* ENC_VISCII, ENC_VSCII, ENC_TIS620, ENC_UTF8, */
  ENC_DUMMY
};

#define ENC_ISO8859_LAST ENC_ISO8859_15


/*
 * Used for tables of locale/encoding names -> encodng labels.
 */

struct name2encoding {
  const char     *name;
  const enum enc_label encoding;
};

/*
 * Used for tables of encoding labels -> Eterm internal informations.
 *
 */

struct defaultfont {
  const enum enc_label enc_label;
  const char     *encoding_method;
  const int      def_idx; 
  const char     *font[NFONTS];
  const char     *mfont[NFONTS];
};


/*
 *****************************************************************************
 * FONT DEFINITIONS
 *****************************************************************************
 */

/*
 *  FONTS TO BE USED
 *
 * ----------------------------------------------------------------------
 * font name       font package name      available from
 * ----------------------------------------------------------------------
 * k12             shinonome
 *                        http://www.on.cs.keio.ac.jp/~yasu/jp_fonts.html
 * k18             intlfonts              ftp.gnu.org/pub/gnu
 * -*-ming-medium-r-normal-*-big5-0
 *                 cmexfonts
 *                            http://metalab.unc.edu/pub/Linux/X11/fonts/
 * -*-gulim-medium-r-normal-*-ksc5601.1987-0
 *                 baekmuk                ftp.mizi.co.kr/pub/baekmuk/
 * -misc-grfixed-medium-r-*-iso8859-7
 *                 hrnet&hcr
 *       http://www.hellug.gr/gr/howto/howto/pub/html/Hellenic-HOWTO.html
 * -cronyx-fixed-medium-r-*-koi8-u
 *                 Xcyr                   http://sawsoft.newmail.ru/LS/
 * all others      XFree86                http://www.xfree86.org/
 * ----------------------------------------------------------------------
 */

#define DEF_DUMMY DEF_10646
#define NFONT_LIST_NULL NFONT_LIST_10646
#define MFONT_LIST_NULL MFONT_LIST_10646

#define DEF_EUCJ 1
#define NFONT_LIST_EUCJ "6x12","7x14", "8x16", "9x18", "12x24"
#define MFONT_LIST_EUCJ "k12", "k14", "kanji16", "k18", "kanji24"

#define DEF_GB 0
#define NFONT_LIST_GB   "8x16", "12x24", "", "", ""
#define MFONT_LIST_GB \
  "-isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0", \
  "-isas-song ti-medium-r-normal--24-240-72-72-c-240-gb2312.1980-0", \
  "", "", ""

#define DEF_BIG5 0
#define NFONT_LIST_BIG5 "8x16", "9x18", "10x20", "12x24", "13x26"
#define MFONT_LIST_BIG5 \
  "-*-ming-medium-r-normal-*-16-*-*-*-c-*-big5-0",\
  "-*-ming-medium-r-normal-*-18-*-*-*-c-*-big5-0",\
  "-*-ming-medium-r-normal-*-20-*-*-*-c-*-big5-0",\
  "-*-ming-medium-r-normal-*-24-*-*-*-c-*-big5-0",\
  "-*-ming-medium-r-normal-*-26-*-*-*-c-*-big5-0"

#define DEF_EUCKR 1
#define NFONT_LIST_EUCKR "7x14", "8x16", "9x18", "10x20", "12x24"
#define MFONT_LIST_EUCKR \
  "-*-gulim-medium-r-normal--14-*-*-*-*-140-ksc5601.1987-0",\
  "-*-gulim-medium-r-normal--16-*-*-*-*-160-ksc5601.1987-0",\
  "-*-gulim-medium-r-normal--18-*-*-*-*-180-ksc5601.1987-0",\
  "-*-gulim-medium-r-normal--20-*-*-*-*-200-ksc5601.1987-0",\
  "-*-gulim-medium-r-normal--24-*-*-*-*-240-ksc5601.1987-0"

#define DEF_7 1
#define NFONT_LIST_7 \
  "-misc-grfixed-medium-r-semicondensed--10-100-75-75-c-60-iso8859-7",\
  "-misc-grfixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-7",\
  "-misc-grfixed-medium-r-normal--14-110-75-75-c-75-iso8859-7",\
  "-misc-grfixed-medium-r-normal--16-120-75-75-c-75-iso8859-7",\
  "-misc-grfixed-medium-r-normal--25-190-75-75-c-90-iso8859-7"

#define DEF_KOI8R 1
#define NFONT_LIST_KOI8R \
  "-cronyx-fixed-medium-r-normal--10-100-75-75-c-60-koi8-r",\
  "-cronyx-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-r",\
  "-cronyx-fixed-medium-r-normal--13-120-75-75-c-80-koi8-r",\
  "-cronyx-fixed-medium-r-normal--15-140-75-75-c-90-koi8-r",\
  "-cronyx-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r"

#define DEF_KOI8U 1
#define NFONT_LIST_KOI8U \
  "-cronyx-fixed-medium-r-normal--10-100-75-75-c-60-koi8-u",\
  "-cronyx-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-u",\
  "-cronyx-fixed-medium-r-normal--13-120-75-75-c-80-koi8-u",\
  "-cronyx-fixed-medium-r-normal--14-130-75-75-c-70-koi8-u",\
  "-cronyx-fixed-medium-r-normal--15-140-75-75-c-90-koi8-u"

#define DEF_10646 2
#define NFONT_LIST_10646 "5x7", "6x10", "fixed", "8x13", "9x15"
#define MFONT_LIST_10646 \
  "-misc-fixed-medium-r-normal--7-*-*-*-c-*-iso10646-1",\
  "-misc-fixed-medium-r-normal--10-*-*-*-c-*-iso10646-1",\
  "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-*-iso10646-1",\
  "-misc-fixed-medium-r-normal--14-*-*-*-c-*-iso10646-1",\
  "-misc-fixed-medium-r-normal--15-*-*-*-c-*-iso10646-1"

/* special common rule for ISO-8859-* */

#define DEF_8859 2
#define NFONT_LIST_ISO8859X \
  "-misc-fixed-medium-r-normal--7-*-*-*-c-*-iso8859-%d",\
  "-misc-fixed-medium-r-normal--10-*-*-*-c-*-iso8859-%d",\
  "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-*-iso8859-%d",\
  "-misc-fixed-medium-r-normal--13-*-*-*-c-*-iso8859-%d",\
  "-misc-fixed-medium-r-normal--18-*-*-*-c-*-iso8859-%d"


#endif /* _DEFAULTFONT_H_ */