Macro per visualizzare tutti i fonts installati

  • Creatore
    Topic
  • #4808
    Up
    0
    Down
    ::


    Qua ho trovato una macro che dovrebbe generare un dvi per ogni font installato ma non ho capito dove e come fa eseguita.
    La macro è`find `kpsewhich -expand-var='$TEXMFMAIN'`/fonts/tfm -name '*.tfm' -print | \
    sed 's@.*/@@; s@\.tfm$@@' | \
    xargs sh -c 'for i in “$@”; do (echo $i; echo \\\sample\\\bye) | \
    tex testfont; mv testfont.dvi $i.dvi; echo $i.dvi; done' sh`

    Alternativamente c’è la seguente macro

    # first the list of files is generated

    `find /usr/share/texmf/fonts/tfm -name '*.tfm' -print |\
    sed 's@.*/@@; s@\.tfm$@@' > available_fonts.lst`

    # then run the following script font_lister.pl

    `#!/usr/bin/perl -w
    use strict;

    my $i = 0;
    my $lst = {};
    my $couter_fonts = 0;
    my $couter_files = 0;

    open(F, “available_fonts.lst”);
    while(){
    chomp;
    $lst->{enc($i++)} = $_;
    }
    close F;

    open (F, “+>lst_”.$couter_files.”.tex\n”);
    print F qq(\\documentclass{article}\n);
    print F qq(\n\\begin{document}\n);
    foreach(sort keys %{$lst}){
    if (!(++$couter_fonts % 100)){
    $couter_files ++;
    $couter_fonts = 0;
    print F “\\end{document}\n”;
    close F;
    open (F, “+>lst_”.$couter_files.”.tex\n”);
    print F qq(\\documentclass{article}\n);
    print F qq(\n\\begin{document}\n);
    }
    print F “\\newfont{\\myFont$_}{ $lst->{$_} }\n”;
    print F “\\myFont$_ $lst->{$_} : Sample Text \\\\ \n”;
    }
    print F qq(\\end{document}\n);
    close F;

    sub enc{
    my $out = “”;
    foreach(split //, shift){
    $out .= chr($_+65);
    }
    return $out;
    }`

    # when this is done (real fast) and run this shell command in the same directory

    `for x in lst_?.tex; do latex $x; done`

    Ringrazio in anticipo chiunque possa delucidarmi sul dafarsi.

Visualizzazione 1 filone di risposte
  • Autore
    Risposte
    • #4809
      ev
      Partecipante
        Up
        0
        Down
        ::


        Per il primo: una shell Bourne-like, le classiche core utils di un sistems Unix-like ed una distribuzione di TeX con la libreria Kpathsea.

        Per il secondo: una shell Bourne-like ed un’installazione minima di Perl.

      • #4810
        Up
        0
        Down
        ::


        Quindi per me che uso Windows e che so a mala pena che Perl esiste non c’è speranza? Vabbé, almeno ci ho tentato. Grazie.

    Visualizzazione 1 filone di risposte
    • Devi essere connesso per rispondere a questo topic.

    Go to top