File: encoding.h

package info (click to toggle)
a2ps 1%3A4.15.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,716 kB
  • sloc: ansic: 44,830; sh: 11,625; lex: 1,851; perl: 708; yacc: 698; makefile: 494; lisp: 396; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (99 lines) | stat: -rw-r--r-- 3,519 bytes parent folder | download | duplicates (2)
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
/* encoding.h - definition of the char encodings used
   Copyright 1988-2017 Free Software Foundation, Inc.

   This program 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, or (at your option)
   any later version.

   This program 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 this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
   02110-1301, USA.  */

/************************************************************************/
/*			encoding selection				*/
/************************************************************************/
#ifndef _ENCODING_H_
#define _ENCODING_H_
#include "a2ps.h"
#include "faces.h"
#include "hashtab.h"

struct a2ps_job;	/* Declared in jobs.h which includes this file */

#define COURIER_WX	600	/* Any char in courier has WX = 600 */

/*
 * Computation of the width of the chars in the current encoding
 */
unsigned int char_WX (struct a2ps_job * job, unsigned char c);
unsigned int string_WX (struct a2ps_job * job, char * string);
unsigned int char_composite_WX (struct a2ps_job * job);


/************************************************************************/
/* Handling of the struct encoding				*/
/************************************************************************/
struct encoding;

const char * encoding_get_name (struct encoding * enc);
const char * encoding_get_key (struct encoding * enc);
void encoding_self_print (struct encoding * item,
					FILE * stream);
int encoding_char_exists (struct encoding * enc,
					enum face_e face, char c);
int encoding_get_composite_flag (struct encoding * enc);
struct encoding *
get_encoding_by_alias (struct a2ps_job * job,
			       char *string);

void set_encoding (struct a2ps_job * job,
			   struct encoding * enc);

/* When FONT_NAME is used with ENCODING, return the real font name to
 * use (e.g., in latin2, Courier-Ogonki should be returned when asked
 * for Courier).  */
const char * encoding_resolve_font_substitute
	(struct a2ps_job * job,
		 struct encoding * encoding,
		 const char * font_name);


const char * encoding_resolve_composite_font
	(struct encoding * encoding,
		 const char * font_name);

/*
 * Have a struct encoding determine the faces_wx
 */
void encoding_build_faces_wx (struct a2ps_job * job,
				      struct encoding * encoding);
void encoding_add_font_name_used (struct encoding * enc,
						const char * name);

/* Dump on STREAM the encodings setup */
void dump_encodings_setup (FILE * stream, struct a2ps_job * job);

/*
 * Related to a2ps_job
 */
void list_encodings_short (struct a2ps_job * job, FILE * stream);
void list_encodings_long (struct a2ps_job * job, FILE * stream);
void list_texinfo_encodings_long (struct a2ps_job * job,
					  FILE * stream);

/************************************************************************/
/* Road map to the files defining the encodings				*/
/************************************************************************/
struct pair_htable * encodings_map_new (void);

struct hash_table_s * encodings_table_new (void);

int load_main_encodings_map (struct a2ps_job * job);
#endif