commit dffed01fd15bd90f6c74da2145c905222198f88d
parent 4865c50adcfae868cebefc74cf0c384ae41b46c2
Author: Kyle Milz <krwmilz@gmail.com>
Date: Mon, 23 Aug 2021 21:37:25 +0000
Enable FREETYPE unconditionally
Diffstat:
6 files changed, 1 insertion(+), 61 deletions(-)
diff --git a/dvi-draw.c b/dvi-draw.c
@@ -873,9 +873,7 @@ set_char P2C(wide_ubyte, cmd, wide_ubyte, ch)
}
if (g->addr == -1)
return ERRVAL; /* previously flagged missing char */
-#if FREETYPE
if (currinf.fontp->ft == NULL) /* if not freetype font */
-#endif
{
open_font_file(currinf.fontp);
Fseek(currinf.fontp->file, g->addr, 0);
@@ -1023,7 +1021,6 @@ set_vf_char P2C(wide_ubyte, cmd, wide_ubyte, ch)
}
-#if FREETYPE
/*
* set_ft_char() is used as a set_char routine to handle delayed loading
@@ -1102,7 +1099,6 @@ set_ft_char P2C(wide_ubyte, cmd, wide_ubyte, ch)
# endif
}
-#endif /* FREETYPE */
#ifndef TEXXET
@@ -1545,10 +1541,8 @@ geom_do_char(g_info, ch)
if (currinf.set_char_p == set_empty_char)
return 0; /* error; we'll catch it later */
-#if FREETYPE
if (currinf.set_char_p == set_ft_char)
do_load_freetype_font();
-#endif
if (currinf.set_char_p == load_n_set_char) {
if (ev_flags & EV_GE_NEWDOC) /* if abort */
@@ -1575,9 +1569,7 @@ geom_do_char(g_info, ch)
return 0; /* catch the error later */
if (g->addr == -1)
return 0; /* previously flagged missing char */
-#if FREETYPE
if (currinf.fontp->ft == NULL)
-#endif
{
open_font_file(currinf.fontp);
Fseek(currinf.fontp->file, g->addr, 0);
diff --git a/dvi-init.c b/dvi-init.c
@@ -31,10 +31,8 @@ NOTE:
#include "dvi.h"
#include <sys/stat.h>
-#if FREETYPE
# include <ft2build.h>
# include FT_SIZES_H
-#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
@@ -263,14 +261,12 @@ load_font(fontp)
fontp->timestamp = ++current_timestamp;
fontp->maxchar = maxchar = 255;
fontp->set_char_p = set_char;
-#if FREETYPE
if (fontp->ft != NULL) { /* if freetype font */
fontp->set_char_p = set_ft_char;
fontp->glyph = xmalloc(256 * sizeof(struct glyph));
bzero((char *) fontp->glyph, 256 * sizeof(struct glyph));
return True;
}
-#endif
fontp->fsize = size_found;
magic = two(fontp->file);
if (magic == PK_MAGIC) read_PK_index(fontp, WIDENINT hushcs);
@@ -438,14 +434,12 @@ define_font(FILE *file, wide_ubyte cmnd, struct font *vfparent,
fontp->flags = FONT_IN_USE;
fontp->dimconv = scale * scale_dimconv / (1<<20);
fontp->set_char_p = load_n_set_char;
-#if FREETYPE
fontp->ft = NULL;
/* spsize = scaled size of the font in spell units,
* = scale * [vfparent->]dimconv.
*/
fontp->spsize =
(vfparent != NULL ? vfparent->dimconv : dimconv) * scale;
-#endif
if (vfparent == NULL)
if (!load_font(fontp)) {
if (ev_flags & EV_GE_NEWDOC) { /* if aborting */
@@ -598,7 +592,6 @@ read_postamble()
*fontpp = fontp->next; /* remove from list */
free(fontp->fontname);
if (fontp->flags & FONT_LOADED) {
-#if FREETYPE
if (fontp->ft != NULL) { /* if FreeType font */
struct ftfont *ft;
@@ -632,14 +625,11 @@ read_postamble()
fp2->next_size = fontp->next_size;
}
}
-#endif
if (fontp->file != NULL) {
Fclose(fontp->file);
++n_files_left;
}
-#if FREETYPE
if (fontp->filename != NULL)
-#endif
free((void *) fontp->filename);
if (fontp->flags & FONT_VIRTUAL) {
diff --git a/font-open.c b/font-open.c
@@ -165,7 +165,6 @@ static double magsteps[10] = {1.0, 1.2, 1.44, 1.728, 2.0736,
2.48832, 2.985984, 3.5831808,
4.29981696, 5.159780352};
-#if FREETYPE
/*
* Information on how to search for dvips configuration files.
@@ -307,7 +306,6 @@ static struct findrec search_type1 = {
}
};
-#endif /* FREETYPE */
static int
@@ -359,7 +357,6 @@ get_sizes(size_list, spp)
}
-#if FREETYPE
/*
* The following code handles lookup of Type 1 fonts for use as FreeType
@@ -620,10 +617,8 @@ dvips_parse(line)
}
t1p->encname = t1p->addinfo = NULL;
-# if FREETYPE
t1p->bad = False;
t1p->ft = NULL;
-# endif
if (encl != 0) {
t1p->encname = q;
@@ -1300,7 +1295,6 @@ pre_lookup_t1_font(fontname)
* lookup_t1_font - Find a Type 1 font (or return NULL).
*/
-# if FREETYPE
static struct avl_t1 *
lookup_t1_font(fontp)
@@ -1344,7 +1338,6 @@ lookup_t1_font(fontp)
return t1p;
}
-# endif /* FREETYPE */
FILE *
open_t1_font(t1p, path_ret)
@@ -1530,7 +1523,6 @@ read_encoding(encp)
++n_files_left;
}
-#endif /* FREETYPE */
void
@@ -1540,10 +1532,8 @@ init_font_open()
int *sp, *sp1;
unsigned int n;
char *p;
-#if FREETYPE
FILE *f;
const char *dvipsrc;
-#endif
Sprintf(bdpi_string, "%d", pixels_per_inch);
@@ -1659,7 +1649,6 @@ init_font_open()
n = *sp1++ = *sp;
sizend = sp1;
-#if FREETYPE
/*
* Initialize reading of Type 1 fonts and map files
* (PS uses T1 fonts for MetaPost figures).
@@ -1745,7 +1734,6 @@ init_font_open()
Fprintf(stderr, "Cannot open map file %s\n", p_head->value);
p_head = p_head->next;
}
-#endif /* FREETYPE */
}
/*
@@ -2278,7 +2266,6 @@ PRE_FONT_OPEN(fontp, fontname, fdpi, magstepval, name_ret, dpi_ret)
*dpi_ret = dpi = fdpi + 0.5;
-#if FREETYPE
/*
* First look for a scalable font.
*/
@@ -2297,7 +2284,6 @@ PRE_FONT_OPEN(fontp, fontname, fdpi, magstepval, name_ret, dpi_ret)
if (debug & DBG_OPEN)
Printf("lookup_t1_font(%s) --> not found\n", fontp->fontname);
}
-#endif
/*
* Loop over sizes. Try actual size first, then closest sizes.
diff --git a/util.c b/util.c
@@ -485,7 +485,6 @@ snum(fp, size)
}
-#if FREETYPE
/*
* General AVL tree mechanism. Search for a node, and return it if found.
@@ -622,7 +621,6 @@ avladd(key, key_len, headp, size)
return ap;
}
-#endif /* FREETYPE */
/*
diff --git a/xdvi.c b/xdvi.c
@@ -90,7 +90,7 @@ static char copyright[] UNUSED =
#endif
#ifndef BDPI
-#define BDPI 300
+#define BDPI 600
#endif
#ifndef MFMODE
@@ -246,10 +246,8 @@ static XrmOptionDescRec options[] = {
{"+nofork", ".fork", XrmoptionNoArg, (XPointer) "on"},
{"-l", ".listFonts", XrmoptionNoArg, (XPointer) "on"},
{"+l", ".listFonts", XrmoptionNoArg, (XPointer) "off"},
-#if FREETYPE
{"-nofreetypefonts", ".freetypeFonts", XrmoptionNoArg, (XPointer) "off"},
{"+nofreetypefonts", ".freetypeFonts", XrmoptionNoArg, (XPointer) "on"},
-#endif
#ifdef BUTTONS
{"-expert", ".expert", XrmoptionNoArg, (XPointer) "on"},
{"+expert", ".expert", XrmoptionNoArg, (XPointer) "off"},
@@ -445,10 +443,8 @@ static XtResource application_resources[] = {
offset(src_fork), XtRString, "true"},
{"listFonts", "ListFonts", XtRBoolean, sizeof(Boolean),
offset(_list_fonts), XtRString, "false"},
-#if FREETYPE
{"freetypeFonts", "FreetypeFonts", XtRBoolean, sizeof(Boolean),
offset(freetype), XtRString, "true"},
-#endif
{"reverseVideo", "ReverseVideo", XtRBoolean, sizeof(Boolean),
offset(reverse), XtRString, "false"},
{"warnSpecials", "WarnSpecials", XtRBoolean, sizeof(Boolean),
diff --git a/xdvi.h b/xdvi.h
@@ -84,10 +84,8 @@ typedef char Bool3; /* Yes/No/Maybe */
#include <dirent.h>
#define NAMLEN(dirent) strlen((dirent)->d_name)
-#if FREETYPE
# include <ft2build.h>
# include FT_FREETYPE_H
-#endif
#ifndef KPATHSEA
@@ -337,13 +335,11 @@ struct font {
struct tn *vf_chain; /* ditto, if TeXnumber >= VFTABLELEN */
struct font *first_font; /* first font defined */
struct macro *macro;
-#if FREETYPE
/* these fields are used by (loaded) FreeType fonts */
struct ftfont *ft; /* master record for font (all sizes) */
double spsize; /* scaled size of font in spell units */
FT_Size size;
struct font *next_size; /* next font from same face */
-#endif
/* I suppose the above could be put into a union, but we */
/* wouldn't save all that much space. */
};
@@ -398,9 +394,7 @@ extern struct _resource {
const char *src_pos;
Boolean src_fork;
Boolean _list_fonts;
-#if FREETYPE
Boolean freetype;
-#endif
Boolean reverse;
Boolean _warn_spec;
Boolean _hush_chars;
@@ -727,7 +721,6 @@ char *ffline = NULL; /* an array used by filefind to store */
size_t ffline_len = 0; /* current length of ffline[] */
-#if FREETYPE
/*
* AVL tree structures.
@@ -751,14 +744,11 @@ struct avl_t1 {
const char *fontfile; /* (short) name of pfa/pfb file */
const char *encname; /* (short) name of encoding file */
const char *addinfo; /* additional PS instructions */
-# if FREETYPE
Boolean bad; /* if later found to be unloadable */
struct ftfont *ft; /* pointer to FreeType record */
-# endif
};
-# if FREETYPE
struct ftfont { /* info for FreeType font (Type 1 or TrueType) */
FT_Face face; /* NULL means not loaded yet */
@@ -770,7 +760,6 @@ struct ftfont { /* info for FreeType font (Type 1 or TrueType) */
double expn; /* expansion factor */
};
-# endif
struct avl_enc {
AVL_COMMON;
@@ -778,7 +767,6 @@ struct avl_enc {
const char *vec[256];
};
-#endif /* FREETYPE */
/*
@@ -877,16 +865,12 @@ extern void reload_dvi_file(void);
extern long set_char(wide_ubyte);
extern long load_n_set_char(wide_ubyte);
extern long set_vf_char(wide_ubyte);
-# if FREETYPE
extern long set_ft_char(wide_ubyte);
-# endif
#else
extern void set_char(wide_ubyte, wide_ubyte);
extern void load_n_set_char(wide_ubyte, wide_ubyte);
extern void set_vf_char(wide_ubyte, wide_ubyte);
-# if FREETYPE
extern long set_ft_char(wide_ubyte, wide_ubyte);
-# endif
#endif
extern void open_font_file(struct font *);
extern void prescan(void);
@@ -897,10 +881,8 @@ extern void source_forward_search(const char *);
#if CFGFILE
extern void readconfig(void);
#endif
-#if FREETYPE
extern FILE *open_t1_font(struct avl_t1 *, const char **);
extern void read_encoding(struct avl_enc *);
-#endif
extern void init_font_open(void);
extern Boolean font_open(struct font *, char **, int *);
extern void init_prescan(void);
@@ -930,9 +912,7 @@ extern DIR *xopendir(const char *);
extern const struct passwd *ff_getpw(const char **, const char *);
extern unsigned long num(FILE *, int);
extern long snum(FILE *, int);
-#if FREETYPE
extern struct avl *avladd(const char *, size_t, struct avl **, size_t);
-#endif
extern size_t property_get_data(Window, Atom, unsigned char **,
int (*x_get_property) (Display *, Window, Atom, long,
long, Bool, Atom, Atom *, int *, unsigned long *,
@@ -941,9 +921,7 @@ extern void prep_fd(int, wide_bool);
extern void read_PK_index(struct font *, wide_bool);
extern void read_GF_index(struct font *, wide_bool);
extern void read_VF_index(struct font *, wide_bool);
-#if FREETYPE
extern Boolean load_ft_font(struct font *);
-#endif
_XFUNCPROTOEND