diff options
Diffstat (limited to 'Build/source/texk/web2c/mpdir/mapfile.c')
-rw-r--r-- | Build/source/texk/web2c/mpdir/mapfile.c | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/Build/source/texk/web2c/mpdir/mapfile.c b/Build/source/texk/web2c/mpdir/mapfile.c index 1893b55bfd7..4887c19ad5e 100644 --- a/Build/source/texk/web2c/mpdir/mapfile.c +++ b/Build/source/texk/web2c/mpdir/mapfile.c @@ -53,10 +53,6 @@ mapitem *mitem = NULL; fm_entry *fm_cur; static const char nontfm[] = "<nontfm>"; -static fm_entry *loaded_tfm_found; -static fm_entry *avail_tfm_found; -static fm_entry *non_tfm_found; -static fm_entry *not_avail_tfm_found; #define read_field(r, q, buf) do { \ q = buf; \ @@ -726,152 +722,6 @@ ff_entry *check_ff_exist (fm_entry * fm) return ff; } -/**********************************************************************/ - -static boolean used_tfm (fm_entry * p) -{ - fontnumber f; - strnumber s; - ff_entry *ff; - - /* check if the font file is not a TrueType font */ - /* font replacement makes sense only for included Type1 files */ - if (is_truetype (p) || !is_included (p)) - return false; - - /* check if the font file is available */ - ff = check_ff_exist (p); - if (ff->ff_path == NULL) - return false; - - /* check whether this font has been used */ - if (fontsizes[p->tfm_num]!=0) - return true; - assert (p->tfm_name != NULL); - - /* check whether we didn't find a loaded font yet, - * and this font has been loaded */ - if (loaded_tfm_found == NULL && strcmp (p->tfm_name, nontfm)) { - s = maketexstring (p->tfm_name); - if ((f = tfmlookup (s, 0)) != getnullfont ()) { - loaded_tfm_found = p; - if (mpfontmap[f] == NULL) - mpfontmap[f] = (fmentryptr) p; - if (p->tfm_num == getnullfont ()) - p->tfm_num = f; - assert (p->tfm_num == f); - /* don't call flushstr() here as it has been called by tfmlookup() */ - } else - flushstr (s); - } - - /* check whether we didn't find either a loaded or a loadable font yet, - * and this font is loadable */ - if (avail_tfm_found == NULL && loaded_tfm_found == NULL && - strcmp (p->tfm_name, nontfm)) { - if (p->tfm_avail == TFM_UNCHECKED) { - if (kpse_find_file (p->tfm_name, kpse_tfm_format, 0) != NULL) { - avail_tfm_found = p; - p->tfm_avail = TFM_FOUND; - } else { - p->tfm_avail = TFM_NOTFOUND; - if (not_avail_tfm_found == NULL) - not_avail_tfm_found = p; - } - } - } - - /* check whether the current entry is a <nontfm> entry */ - if (non_tfm_found == NULL && !strcmp (p->tfm_name, nontfm)) - non_tfm_found = p; - - return false; -} - -/* lookup_ps_name looks for an entry with a given ps name + slant + extend; - * return NULL if not found. - * - * As there may exist several such entries, we need to select the `right' - * one. We do so by checking all such entries and return the first one that - * fulfils the following criteria (in descending priority): - * - * - the tfm has been used (some char from this font has been typeset) - * - the tfm has been loaded (but not used yet) - * - the tfm can be loaded (but not loaded yet) - * - the tfm is present in map files, but cannot be loaded. In this case a - * dummy tfm can be loaded instead, and a warning should be written out - */ - -static fm_entry *lookup_ps_name (fm_entry * fm) -{ - fm_entry *p, *p2; - struct avl_traverser t, t2; - int a; - - loaded_tfm_found = NULL; - avail_tfm_found = NULL; - non_tfm_found = NULL; - not_avail_tfm_found = NULL; - - assert (fm->tfm_name == NULL); - p = (fm_entry *) avl_t_find (&t, ps_tree, fm); - if (p == NULL) - return NULL; - t2 = t; - p2 = (fm_entry *) avl_t_prev (&t2); - - /* search forward */ - do { - if (used_tfm (p)) - return p; - p = (fm_entry *) avl_t_next (&t); - } - while (p != NULL && comp_fm_entry_ps (fm, p, NULL) == 0); - - /* search backward */ - while (p2 != NULL && comp_fm_entry_ps (fm, p2, NULL) == 0) { - if (used_tfm (p2)) - return p2; - p2 = (fm_entry *) avl_t_prev (&t2); - } - - if (loaded_tfm_found != NULL) - p = loaded_tfm_found; - else if (avail_tfm_found != NULL) { - /* TH: do not do this for metapost, there is no embedding anyway */ - /* p = avail_tfm_found; - * p->tfm_num = readfontinfo (getnullcs (), maketexstring (p->tfm_name), - * getnullstr (), -1000); - * p->tfm_avail = TFM_FOUND; - */ - } else if (non_tfm_found != NULL) { - p = non_tfm_found; - p->tfm_num = newdummyfont (); - p->tfm_avail = TFM_FOUND; - } else if (not_avail_tfm_found != NULL) { - p = not_avail_tfm_found; - pdftex_warn ("`%s' not loadable, use a dummy tfm instead", p->tfm_name); - p2 = new_fm_entry (); - p2->flags = p->flags; - p2->encoding = p->encoding; - p2->type = p->type; - p2->slant = p->slant; - p2->extend = p->extend; - p2->tfm_name = xstrdup (nontfm); - p2->ps_name = xstrdup (p->ps_name); - if (p->ff_name != NULL) - p2->ff_name = xstrdup (p->ff_name); - p2->tfm_num = newdummyfont (); - p2->tfm_avail = TFM_FOUND; - a = avl_do_entry (p2, FM_DUPIGNORE); - assert (a == 0); - p = p2; - } else - return NULL; - assert (p->tfm_num != getnullfont ()); - return p; -} - /**********************************************************************/ /* |