def _parse_kern_pairs(fh):
line = fh.readline()<EOL>if not line.startswith('<STR_LIT>'):<EOL><INDENT>raise RuntimeError('<STR_LIT>'%line)<EOL><DEDENT>d = {}<EOL>while <NUM_LIT:1>:<EOL><INDENT>line = fh.readline()<EOL>if not line: break<EOL>line = line.rstrip()<EOL>if len(line)==<NUM_LIT:0>: continue<EOL>if line.startswith('<STR_LIT>'):<EOL><INDENT>fh.readline()  <EOL>return d<EOL><DEDENT>vals = line.split()<EOL>if len(vals)!=<NUM_LIT:4> or vals[<NUM_LIT:0>]!='<STR_LIT>':<EOL><INDENT>raise RuntimeError('<STR_LIT>'%line)<EOL><DEDENT>c1, c2, val = vals[<NUM_LIT:1>], vals[<NUM_LIT:2>], _to_float(vals[<NUM_LIT:3>])<EOL>d[(c1,c2)] = val<EOL><DEDENT>raise RuntimeError('<STR_LIT>')<EOL>
Return a kern pairs dictionary; keys are (*char1*, *char2*) tuples and
values are the kern pair value.  For example, a kern pairs line like
``KPX A y -50``

will be represented as::

  d[ ('A', 'y') ] = -50