Logo Search packages:      
Sourcecode: kayali version File versions  Download package

def pdf::afm::_parse_composites (   fh  )  [private]

Return a composites dictionary.  Keys are the names of the
composites.  vals are a num parts list of composite information,
with each element being a (name, dx, dy) tuple.  Thus if a
composites line reading:

  CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;

will be represented as

  d['Aacute'] = [ ('A', 0, 0), ('acute', 160, 170) ]
  

Definition at line 234 of file afm.py.

00234                          :
    """
    Return a composites dictionary.  Keys are the names of the
    composites.  vals are a num parts list of composite information,
    with each element being a (name, dx, dy) tuple.  Thus if a
    composites line reading:

      CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;

    will be represented as

      d['Aacute'] = [ ('A', 0, 0), ('acute', 160, 170) ]
      
    """
    d = {}
    while 1:
        line = fh.readline()
        if not line: break
        line = line.rstrip()
        if len(line)==0: continue
        if line.startswith('EndComposites'):
            return d
        vals = line.split(';')
        cc = vals[0].split()
        name, numParts = cc[1], _to_int(cc[2])
        pccParts = []
        for s in vals[1:-1]:
            pcc = s.split()
            name, dx, dy = pcc[1], _to_float(pcc[2]), _to_float(pcc[3])
            pccParts.append( (name, dx, dy) )
        d[name] = pccParts

    raise RuntimeError('Bad composites parse')

def _parse_optional(fh):


Generated by  Doxygen 1.6.0   Back to index