protected function  o_fontEncoding($id, $action, $options = '') {
    if  ($action !== 'new') {
      $o = & $this->objects[$id];
    }

    switch  ($action) {
    case  'new':
      // the options array should contain 'differences' and maybe 'encoding'
      $this->objects[$id] = array('t'=>'fontEncoding', 'info'=>$options);
      break;

    case  'out':
      $res = "\n$id 0 obj\n<< /Type /Encoding\n";
      if  (!isset($o['info']['encoding'])) {
        $o['info']['encoding'] = 'WinAnsiEncoding';
      }

      if  ($o['info']['encoding'] !== 'none') {
        $res.= "/BaseEncoding /".$o['info']['encoding']."\n";
      }

      $res.= "/Differences \n[";

      $onum = -100;

      foreach($o['info']['differences'] as  $num=>$label) {
        if  ($num != $onum+1) {
          // we cannot make use of consecutive numbering
          $res.=  "\n$num /$label";
        } else {
          $res.=  " /$label";
        }

        $onum = $num;
      }

      $res.= "\n]\n>>\nendobj";
      return  $res;
    }
  }