Ignore:
Timestamp:
Feb 8, 2010, 2:27:22 AM (10 years ago)
Author:
Sam Hocevar
Message:

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/figfont.php

    r3177 r4333  
    1212 */
    1313
    14 function unistr_to_ords($str, $encoding = 'UTF-8'){       
    15         $str = mb_convert_encoding($str, "UCS-4BE", $encoding);
    16         $result = array();
     14function unistr_to_ords($str, $encoding = 'UTF-8'){
     15    $str = mb_convert_encoding($str, "UCS-4BE", $encoding);
     16    $result = array();
    1717
    18         for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){       
    19                 $c = mb_substr($str, $i, 1, "UCS-4BE");                   
    20                 $val = unpack("N", $c);           
    21                 $result[] = $val[1];               
    22         }       
    23         return $result;
     18    for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){
     19        $c = mb_substr($str, $i, 1, "UCS-4BE");
     20        $val = unpack("N", $c);
     21        $result[] = $val[1];
     22    }
     23    return $result;
    2424}
    2525
    2626if (php_sapi_name() != "cli") {
    27         die("You have to run this program with php-cli!\n");
     27    die("You have to run this program with php-cli!\n");
    2828}
    2929
    3030if ($argc < 3) {
    31         die("Too few arguments.\nUsage: cmd <path of font> <utf8 string>\n");
     31    die("Too few arguments.\nUsage: cmd <path of font> <utf8 string>\n");
    3232}
    3333
     
    3535
    3636if (!caca_canvas_set_figfont($cv, $argv[1])) {
    37         die("Could not open font\n");
     37    die("Could not open font\n");
    3838}
    3939
     
    4141$color = 0;
    4242foreach ($chars as $c) {
    43         caca_set_color_ansi($cv, 1 + (($color += 4) % 15), CACA_TRANSPARENT);
    44         caca_put_figchar($cv, $c);
     43    caca_set_color_ansi($cv, 1 + (($color += 4) % 15), CACA_TRANSPARENT);
     44    caca_put_figchar($cv, $c);
    4545}
    4646
Note: See TracChangeset for help on using the changeset viewer.