summaryrefslogtreecommitdiff
path: root/charspace/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'charspace/main.c')
-rw-r--r--charspace/main.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/charspace/main.c b/charspace/main.c
index 089b329..ec3cd78 100644
--- a/charspace/main.c
+++ b/charspace/main.c
@@ -76,21 +76,21 @@ static string *scan_string_list (string);
value for most of the other side bearings can be determined
(independent of the typeface) as a percentage of those ``control
letters'' sidebearings.
-
+
The basic strategy is to first read `common.cmi', which specifies the
font-independent side bearing apportionments. Then we read
font-specific CMI files to actually define the side bearing values,
specify kerns, and so on.
-
+
This defines a whole bunch of things in the symbol table (see
`symtab.c'). We then resolve the side bearing information for all
the characters we will output, after all the definitions have been
read.
-
+
Then we output the revised GF and TFM files. We read an existing TFM
file and an encoding file, as well as accepting various options, to
get lig/kern and other TFM information. */
-
+
int
main (int argc, string argv[])
{
@@ -125,7 +125,7 @@ main (int argc, string argv[])
/* Set the numeric counterpart of `dpi', for use in lots of places. */
dpi_real = atof (dpi);
-
+
/* If the user didn't specify CMI files to read, then use
`<input_name>.<dpi>cmi'. */
if (cmi_names == NULL)
@@ -141,11 +141,11 @@ main (int argc, string argv[])
/* Read all the CMI information. */
read_cmi_file ("common.cmi", "");
read_cmi_file_list (cmi_names, dpi);
-
+
/* Figure out the font encoding scheme. Must be done after reading
the CMI files, since they can specify the codingscheme. */
encoding_info = read_encoding_info (encoding_name);
-
+
/* The main loop: compute each character's information. */
for (code = starting_char; code <= ending_char; code++)
{
@@ -158,7 +158,7 @@ main (int argc, string argv[])
close_font (input_name);
if (have_tfm)
tfm_close_input_file ();
-
+
return 0;
}
@@ -166,14 +166,14 @@ main (int argc, string argv[])
1) USER_NAME (if it's non-null);
2) the value of `codingscheme' in the symbol table (if it's a string);
3) the codingscheme from an existing TFM file (if we have one).
-
+
Otherwise, give a fatal error. */
static encoding_info_type
read_encoding_info (string user_name)
{
encoding_info_type ei;
-
+
if (user_name != NULL)
ei = read_encoding_file (user_name);
else
@@ -187,16 +187,16 @@ read_encoding_info (string user_name)
else if (SYMVAL_TAG (*sv) == symval_string)
codingscheme = SYMVAL_STRING (*sv);
-
+
else
FATAL ("codingscheme: defined (in CMI file) as a non-string");
-
+
assert (codingscheme != NULL);
-
+
enc_name = coding_scheme_to_filename (codingscheme);
ei = read_encoding_file (enc_name);
}
-
+
return ei;
}
@@ -256,25 +256,25 @@ read_command_line (int argc, string argv[])
{ "version", 0, (int *) &printed_version, 1 },
{ "xheight-char", 1, 0, 0 },
{ 0, 0, 0, 0 } };
-
+
while (true)
{
g = getopt_long_only (argc, argv, "", long_options, &option_index);
-
+
if (g == EOF)
break;
if (g == '?')
continue; /* Unknown option. */
-
+
assert (g == 0); /* We have no short option names. */
-
+
if (ARGUMENT_IS ("cmi-files"))
cmi_names = scan_string_list (optarg);
else if (ARGUMENT_IS ("dpi"))
dpi = optarg;
-
+
else if (ARGUMENT_IS ("encoding"))
encoding_name = optarg;
@@ -293,22 +293,22 @@ read_command_line (int argc, string argv[])
else if (ARGUMENT_IS ("range"))
GET_RANGE (optarg, starting_char, ending_char);
-
+
else if (ARGUMENT_IS ("version"))
printf ("%s.\n", version_string);
-
+
else if (ARGUMENT_IS ("xheight-char"))
xheight_char = xparse_charcode (optarg);
-
+
/* Else it was just a flag; getopt has already done the assignment. */
}
-
+
FINISH_COMMAND_LINE ();
}
/* Take a string L consisting of unsigned strings separated by commas
- and return a vector of the strings, as pointers.
+ and return a vector of the strings, as pointers.
Append an element to the vector. */
static string *
@@ -317,14 +317,14 @@ scan_string_list (string l)
string map;
unsigned length = 1;
string *vector = xmalloc (sizeof (string));
-
+
for (map = strtok (l, ","); map != NULL; map = strtok (NULL, ","))
{
length++;
vector = xrealloc (vector, length * sizeof (string));
vector[length - 2] = map;
}
-
+
vector[length - 1] = NULL;
return vector;
}