French accented characters

idextrus
2004-12-26
2012-12-04
  • idextrus
    idextrus
    2004-12-26

    I have read the manual and read a number of posts in this forum, but I am just not getting it. How do I set up accented french characters to work with this class? From the manual I see this:
    $diff=array(196=>'Adieresis',228=>'adieresis',
    214=>'Odieresis',246=>'odieresis',
    220=>'Udieresis',252=>'udieresis',
    223=>'germandbls');
    // and the first time that you call selectFont for each font, use
    $pdf-
    >selectFont('<fontname>',array('encoding'=>'WinAnsiEncoding','differe
    nces'=>$diff));

    But don't understand how to set up the french accents (, ,  etc).

    Can anyone help me?

    Thanks!

    Chris

     
    • idextrus
      idextrus
      2005-01-03

      Any thoughts on this?? I really need to get this happening soon.

      Thanks

       
    • $diff=array(
      196=>'Adieresis',
      228=>'adieresis',
      214=>'Odieresis',
      246=>'odieresis',
      220=>'Udieresis',
      252=>'udieresis',
      223=>'germandbls',
      224=>'agrave',
      225=>'aacute',
      232=>'egrave',
      233=>'eacute',
      236=>'igrave',
      237=>'iacute',
      242=>'ograve',
      243=>'oacute',
      249=>'ugrave',
      250=>'uacute',
      200=>'Egrave',
      241=>'ntilde'
      );

      For the other accented letters look for a iso-8859-15 conversion table.

      ciao
      Marco Bernardini

       
      • idextrus
        idextrus
        2005-01-04

        Thanks a million Marco!!! Happy New Year.

        Chris

         
      • idextrus
        idextrus
        2005-01-15

        OK, I guess that I am not getting it. Where exactly do I put this $diff array? Do I need to add it into the selectFont function is class.pdf.php? Or can I put it in my user function and call the values by index ($diff[3],$diff[6], etc)?

        I have put it into both and call them like this:
        pr".$diff[8]."senter (for prsenter), but it doesn't print the character to the pdf, in fact there is nothing where that character should be (prsenter).

        I have this as my selectFont declaration:
        $pdf->selectFont('<fontname>',array('encoding'=>'WinAnsiEncoding','differences'=>$diff));

        Help

         
    • mdjalel
      mdjalel
      2007-02-23

      hello

      i have the same probleme withe ( e dans o) and the accent (') : the solution is in the iconv fonction

      $texte = iconv('UTF-8', 'ASCII//TRANSLIT',$texte);

       
    • mdjalel
      mdjalel
      2007-03-15

      i'm sorry for this small error  the good instruction is

      $texte = iconv('UTF-8', 'ISO8859-1//TRANSLIT',$texte);

       
    • Thanks mdjalel. I used in spanish language and works good.

       
    • roggli
      roggli
      2008-12-10

      Hi there
      I've been struggling hours with all this, as my pdf didn't display the correct accented characters. Tryed iconv, the diff array, document encoding etc with no luck. And suddently I saw the light...

      my path to the font folder wasn't correct!!! As I choose Helvetica and the displayed text looked like it, I didn't noticed it at first. Once the path fixed, it worked like a charm, no conversion whatsoever was needed.

      For the new next ones in trouble, first be sure that the path to the font file is correct. This is easily done by changing the font face between two pdf generation and see if it responds like expected.

      best