w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mftrace Namespace Reference

Classes

class  TempDirectory
 

Functions

def interpolate (strng)
 
def _ (s)
 
def shell_escape_filename (strng)
 
def identify (port)
 
def warranty ()
 
def progress (s)
 
def warning (s)
 
def error (s)
 
def setup_temp (name)
 
def popen (cmd, mode='r', ignore_error=0)
 
def system (cmd, ignore_error=0)
 
def strip_extension (f, ext)
 
def find_file (nm)
 
def flag_error ()
 
def autotrace_command (fn, opts)
 TRACING. More...
 
def potrace_command (fn, opts)
 
def trace_one (pbmfile, id)
 
def make_pbm (filename, outname, char_number)
 
def read_encoding (file)
 
def zip_to_pairs (xs)
 
def unzip_pairs (tups)
 
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid, magnification)
 
def potrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid, magnification)
 
def read_gf_dims (name, c)
 
def trace_font (fontname, gf_file, metric, glyphs, encoding, magnification, fontinfo)
 
def ps_encode_encoding (encoding)
 
def gen_unique_id (dict)
 
def to_type1 (outlines, bbox, fontname, encoding, magnification, fontinfo)
 
def update_bbox_with_point (bbox, pt)
 
def update_bbox_with_bbox (bb, dims)
 
def get_binary (name)
 
def get_fontforge_command ()
 
def tfm2kpx (tfmname, encoding)
 
def get_afm (t1_path, tfmname, encoding, out_path)
 
def assemble_font (fontname, format, is_raw)
 
def make_outputs (fontname, formats, encoding)
 
def getenv (var, default)
 
def gen_pixel_font (filename, metric, magnification)
 
def parse_command_line ()
 
def derive_font_name (family, fullname)
 
def cm_guess_font_info (filename, fontinfo)
 
def ec_guess_font_info (filename, fontinfo)
 
def guess_fontinfo (filename)
 
def do_file (filename)
 
def nop ()
 if "MFINPUTS" not in os.environ: os.environ["MFINPUTS"] = os.getcwd () + ";" More...
 
def main ()
 

Variables

string prefix = ''
 
string exec_prefix = prefix
 
string datadir = '%(prefix)s/share/mftrace' % vars()
 
string libdir = datadir
 
 bindir = os.getcwd ()
 
 errorport = sys.stderr
 
 _ = gettext.gettext
 
 temp_dir = None
 
 options = None
 END Library. More...
 
int exit_value = 0
 
string backend_options = ''
 
string program_name = 'mftrace'
 
string program_version = '1.2.20'
 
 origdir = os.getcwd ()
 
dictionary coding_dict
 
 trace_command = None
 
 path_to_type1_ops = None
 
list copied_fields
 apparently, some fonts end the file with cleartomark. More...
 
dictionary vars
 
 clean
 
 tfm_file
 
 metric = tfm.read_tfm_file (options.tfm_file)
 
def fontinfo = guess_fontinfo (basename)
 
string codingfile = 'tex256.enc'
 
def encoding_file = find_file (codingfile)
 
 enc_name
 
 encoding
 
 glyphs
 
def base = gen_pixel_font (basename, metric, options.magnification)
 
 gffile
 
string afmfile = ''
 

Function Documentation

◆ _()

def mftrace._ (   s)
private

Definition at line 67 of file mftrace.py.

References _.

◆ assemble_font()

def mftrace.assemble_font (   fontname,
  format,
  is_raw 
)

Definition at line 793 of file mftrace.py.

◆ autotrace_command()

def mftrace.autotrace_command (   fn,
  opts 
)

TRACING.

Definition at line 241 of file mftrace.py.

◆ autotrace_path_to_type1_ops()

def mftrace.autotrace_path_to_type1_ops (   at_file,
  bitmap_metrics,
  tfm_wid,
  magnification 
)

Definition at line 337 of file mftrace.py.

◆ cm_guess_font_info()

def mftrace.cm_guess_font_info (   filename,
  fontinfo 
)

Definition at line 1137 of file mftrace.py.

◆ derive_font_name()

def mftrace.derive_font_name (   family,
  fullname 
)

Definition at line 1128 of file mftrace.py.

◆ do_file()

def mftrace.do_file (   filename)

Definition at line 1313 of file mftrace.py.

◆ ec_guess_font_info()

def mftrace.ec_guess_font_info (   filename,
  fontinfo 
)

Definition at line 1210 of file mftrace.py.

◆ error()

def mftrace.error (   s)
Report the error S and exit with an error status of 1.

RETURN VALUE

None

Definition at line 96 of file mftrace.py.

Referenced by make_outputs().

◆ find_file()

def mftrace.find_file (   nm)

Definition at line 212 of file mftrace.py.

◆ flag_error()

def mftrace.flag_error ( )

Definition at line 233 of file mftrace.py.

◆ gen_pixel_font()

def mftrace.gen_pixel_font (   filename,
  metric,
  magnification 
)
Generate a GF file for FILENAME, such that `magnification'*mfscale
(default 1000 * 1.0) pixels fit on the designsize.

Definition at line 880 of file mftrace.py.

◆ gen_unique_id()

def mftrace.gen_unique_id (   dict)

Definition at line 593 of file mftrace.py.

◆ get_afm()

def mftrace.get_afm (   t1_path,
  tfmname,
  encoding,
  out_path 
)

Definition at line 767 of file mftrace.py.

◆ get_binary()

def mftrace.get_binary (   name)

Definition at line 699 of file mftrace.py.

Referenced by get_fontforge_command(), and make_outputs().

◆ get_fontforge_command()

def mftrace.get_fontforge_command ( )

Definition at line 708 of file mftrace.py.

References get_binary().

◆ getenv()

def mftrace.getenv (   var,
  default 
)

Definition at line 874 of file mftrace.py.

◆ guess_fontinfo()

def mftrace.guess_fontinfo (   filename)

Definition at line 1282 of file mftrace.py.

◆ identify()

def mftrace.identify (   port)

Definition at line 74 of file mftrace.py.

◆ interpolate()

def mftrace.interpolate (   strng)

Definition at line 32 of file mftrace.py.

◆ main()

def mftrace.main ( void  )

Definition at line 1408 of file mftrace.py.

◆ make_outputs()

def mftrace.make_outputs (   fontname,
  formats,
  encoding 
)
run fontforge to convert to other formats

Definition at line 812 of file mftrace.py.

References error(), get_binary(), print, and vars.

◆ make_pbm()

def mftrace.make_pbm (   filename,
  outname,
  char_number 
)
 Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'.
Return FALSE if the glyph is not valid.

Definition at line 297 of file mftrace.py.

◆ nop()

def mftrace.nop ( )

if "MFINPUTS" not in os.environ: os.environ["MFINPUTS"] = os.getcwd () + ";"

must change dir before calling mktextfm.

Definition at line 1343 of file mftrace.py.

◆ parse_command_line()

def mftrace.parse_command_line ( )

Definition at line 943 of file mftrace.py.

References _, and range.

◆ popen()

def mftrace.popen (   cmd,
  mode = 'r',
  ignore_error = 0 
)

Definition at line 142 of file mftrace.py.

◆ potrace_command()

def mftrace.potrace_command (   fn,
  opts 
)

Definition at line 246 of file mftrace.py.

◆ potrace_path_to_type1_ops()

def mftrace.potrace_path_to_type1_ops (   at_file,
  bitmap_metrics,
  tfm_wid,
  magnification 
)

Definition at line 415 of file mftrace.py.

◆ progress()

def mftrace.progress (   s)

Definition at line 90 of file mftrace.py.

◆ ps_encode_encoding()

def mftrace.ps_encode_encoding (   encoding)

Definition at line 582 of file mftrace.py.

◆ read_encoding()

def mftrace.read_encoding (   file)

Definition at line 306 of file mftrace.py.

◆ read_gf_dims()

def mftrace.read_gf_dims (   name,
  c 
)

Definition at line 515 of file mftrace.py.

◆ setup_temp()

def mftrace.setup_temp (   name)

Definition at line 134 of file mftrace.py.

◆ shell_escape_filename()

def mftrace.shell_escape_filename (   strng)

Definition at line 70 of file mftrace.py.

◆ strip_extension()

def mftrace.strip_extension (   f,
  ext 
)

Definition at line 172 of file mftrace.py.

◆ system()

def mftrace.system (   cmd,
  ignore_error = 0 
)
Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero.

RETURN VALUE

Exit status of CMD

Definition at line 150 of file mftrace.py.

◆ tfm2kpx()

def mftrace.tfm2kpx (   tfmname,
  encoding 
)

Definition at line 723 of file mftrace.py.

◆ to_type1()

def mftrace.to_type1 (   outlines,
  bbox,
  fontname,
  encoding,
  magnification,
  fontinfo 
)
Fill in the header template for the font, append charstrings,
and shove result through t1asm

Definition at line 597 of file mftrace.py.

◆ trace_font()

def mftrace.trace_font (   fontname,
  gf_file,
  metric,
  glyphs,
  encoding,
  magnification,
  fontinfo 
)

Definition at line 521 of file mftrace.py.

◆ trace_one()

def mftrace.trace_one (   pbmfile,
  id 
)
Run tracer, do error handling

Definition at line 255 of file mftrace.py.

◆ unzip_pairs()

def mftrace.unzip_pairs (   tups)

Definition at line 330 of file mftrace.py.

◆ update_bbox_with_bbox()

def mftrace.update_bbox_with_bbox (   bb,
  dims 
)

Definition at line 690 of file mftrace.py.

◆ update_bbox_with_point()

def mftrace.update_bbox_with_point (   bbox,
  pt 
)

Definition at line 681 of file mftrace.py.

◆ warning()

def mftrace.warning (   s)

Definition at line 93 of file mftrace.py.

◆ warranty()

def mftrace.warranty ( )

Definition at line 77 of file mftrace.py.

◆ zip_to_pairs()

def mftrace.zip_to_pairs (   xs)

Definition at line 323 of file mftrace.py.

Variable Documentation

◆ _

mftrace._ = gettext.gettext
private

Definition at line 65 of file mftrace.py.

Referenced by _(), and parse_command_line().

◆ afmfile

string mftrace.afmfile = ''

Definition at line 1406 of file mftrace.py.

Referenced by Afm(), and getenc().

◆ backend_options

def mftrace.backend_options = ''

Definition at line 186 of file mftrace.py.

◆ base

Definition at line 1385 of file mftrace.py.

◆ bindir

mftrace.bindir = os.getcwd ()

Definition at line 47 of file mftrace.py.

Referenced by MiKTeXCom.getBinDir(), and open_dvi_output().

◆ clean

mftrace.clean

Definition at line 1346 of file mftrace.py.

Referenced by write_indirect().

◆ coding_dict

dictionary mftrace.coding_dict
Initial value:
1 = {
2 
3  # from TeTeX
4  'TeX typewriter text': '09fbbfac.enc', # cmtt10
5  'TeX math symbols': '10037936.enc', # cmbsy
6  'ASCII caps and digits': '1b6d048e', # cminch
7  'TeX math italic': 'aae443f0.enc', # cmmi10
8  'TeX extended ASCII': 'd9b29452.enc',
9  'TeX text': 'f7b6d320.enc',
10  'TeX text without f-ligatures': '0ef0afca.enc',
11  'Extended TeX Font Encoding - Latin': 'tex256.enc',
12 
13  # LilyPond.
14  'fetaBraces': 'feta-braces-a.enc',
15  'fetaNumber': 'feta-nummer10.enc',
16  'fetaMusic': 'feta20.enc',
17  'parmesanMusic': 'parmesan20.enc',
18  }

Definition at line 192 of file mftrace.py.

◆ codingfile

dictionary mftrace.codingfile = 'tex256.enc'

Definition at line 1368 of file mftrace.py.

◆ copied_fields

list mftrace.copied_fields
Initial value:
1 = ['FontName', 'FamilyName', 'FullName', 'DesignSize',
2  'ItalicAngle', 'isFixedPitch', 'Weight']

apparently, some fonts end the file with cleartomark.

Don't know why.

Definition at line 653 of file mftrace.py.

◆ datadir

mftrace.datadir = '%(prefix)s/share/mftrace' % vars()

Definition at line 42 of file mftrace.py.

◆ enc_name

◆ encoding

mftrace.encoding

Definition at line 1378 of file mftrace.py.

◆ encoding_file

def mftrace.encoding_file = find_file (codingfile)

Definition at line 1374 of file mftrace.py.

◆ errorport

mftrace.errorport = sys.stderr

Definition at line 54 of file mftrace.py.

◆ exec_prefix

string mftrace.exec_prefix = prefix

Definition at line 41 of file mftrace.py.

◆ exit_value

int mftrace.exit_value = 0

Definition at line 185 of file mftrace.py.

◆ fontinfo

def mftrace.fontinfo = guess_fontinfo (basename)

Definition at line 1364 of file mftrace.py.

Referenced by load_fontdir().

◆ gffile

mftrace.gffile

Definition at line 1386 of file mftrace.py.

◆ glyphs

mftrace.glyphs

Definition at line 1381 of file mftrace.py.

◆ libdir

string mftrace.libdir = datadir

Definition at line 43 of file mftrace.py.

◆ metric

◆ options

mftrace.options = None

END Library.

Definition at line 184 of file mftrace.py.

◆ origdir

mftrace.origdir = os.getcwd ()

Definition at line 190 of file mftrace.py.

◆ path_to_type1_ops

mftrace.path_to_type1_ops = None

Definition at line 253 of file mftrace.py.

◆ prefix

string mftrace.prefix = ''

Definition at line 30 of file mftrace.py.

◆ program_name

string mftrace.program_name = 'mftrace'

Definition at line 187 of file mftrace.py.

◆ program_version

string mftrace.program_version = '1.2.20'

Definition at line 189 of file mftrace.py.

◆ temp_dir

mftrace.temp_dir = None

Definition at line 109 of file mftrace.py.

◆ tfm_file

mftrace.tfm_file

Definition at line 1354 of file mftrace.py.

◆ trace_command

mftrace.trace_command = None

Definition at line 252 of file mftrace.py.

◆ vars

dictionary mftrace.vars
Initial value:
1 = {
2  'VVV': '001',
3  'WWW': '001',
4  'Notice': 'Generated from MetaFont bitmap by mftrace %s, http://www.xs4all.nl/~hanwen/mftrace/ ' % program_version,
5  'UnderlinePosition': '-100',
6  'UnderlineThickness': '50',
7  'xrevscale': 1.0/1000.0,
8  'yrevscale': 1.0/1000.0,
9  'llx': bbox[0],
10  'lly': bbox[1],
11  'urx': bbox[2],
12  'ury': bbox[3],
13  'Encoding': ps_encode_encoding (encoding),
14 
15  # need one extra entry for .notdef
16  'CharStringsLen': len (outlines) + 1,
17  'CharStrings': ' '.join (outlines),
18  'CharBBox': '0 0 0 0',
19  }

Definition at line 656 of file mftrace.py.

Referenced by FcFontRenderPrepare(), handle_glyphvariants(), make_outputs(), and mrb_local_variables().