<?php

function t88_init()
{
  return "\x1b\x40\x1bR\x01";
}
function t88_cr()
{
  return "\x0a";
}
function t88_font($font)
{
  switch ($font) {
    case 0:
      return "\x1b\x21\x00";

    case 1:
      return "\x1b\x21\x01";
  }
}
function t88_size($size)
{
  switch ($size) {
    case 0:
      return "\x1d\x21\x00";

    case 1:
      return "\x1d\x21\x11";

    case 2:
      return "\x1d\x21\x22";

    case 3:
      return "\x1d\x21\x33";

    case 4:
      return "\x1d\x21\x44";

    case 5:
      return "\x1d\x21\x55";

    case 6:
      return "\x1d\x21\x66";

    case 7:
      return "\x1d\x21\x77";
  }
}
function t88_align($pos)
{
  switch ($pos) {
    case 0:
      return "\x1ba\x00";

    case 1:
      return "\x1ba\x01";

    case 2:
      return "\x1ba\x02";
  }
}
function t88_cut()
{
  return "\x1dV\x42\x30";
}
function t88_pulse()
{
  return "\x1bp\x00\x3c\x78";
}
function t88_tab()
{
  return "\x09";
}
function t88_tab_pos()
{
  return "\x1bD\x0f\x13\x00";
}
function t88_convert_string($org)
{
  $out = str_replace("é", "\x82", $org);
  $out = str_replace("â", "\x83", $out);
  $out = str_replace("ä", "\x84", $out);
  $out = str_replace("à", "\x85", $out);
  $out = str_replace("ç", "\x87", $out);
  $out = str_replace("ê", "\x88", $out);
  $out = str_replace("ë", "\x89", $out);
  $out = str_replace("è", "\x8A", $out);
  $out = str_replace("ï", "\x8B", $out);
  $out = str_replace("î", "\x89", $out);
  $out = str_replace("Ä", "\x8E", $out);
  $out = str_replace("É", "\x90", $out);
  $out = str_replace("ô", "\x93", $out);
  $out = str_replace("ö", "\x94", $out);
  $out = str_replace("û", "\x96", $out);
  $out = str_replace("ù", "\x97", $out);
  $out = str_replace("Ö", "\x99", $out);
  $out = str_replace("Ü", "\x9A", $out);
  return $out;
}
