Friday, November 21, 2008

Embed Fonts in HTML document using PHP and Javascript

I wrote a php + js script to replace HTML markup with formatted text in the form of images. The script is called PHPJSFont and it is available at http://code.google.com/p/phpjsfont.

What it does is simple: the Javascript code replaces the text inside HTML tags with an image generated by the PHP script.

Currently it depends on JQuery and PHP 4+ compiled with the GD extension and TTF support.

It should be fairly simple to use, as in:


PJF.replace("h2");
PJF.replace("#topmenu UL > LI");
PJF.replace("h1", { size: 20, color: [255, 0, 0] });

Saturday, November 15, 2008

Install Intel Compiler(icc) in Ubuntu 8.10

To install icc in Ubuntu:

  1. Download icc from Intel website

  2. tar -zxvf the file.

  3. Run 'install.sh'.

  4. Follow the installer instructions.

  5. When it is done add this line to your ~/.bashrc (or initialization script):
    source /opt/intel/Compiler/11.0/069/bin/iccvars.sh ia32
    Replace ia32 with your platform: (ia32, intel64, ia64)

  6. Log off and log in and that is it. You can test it with icc -v

  7. To use icc with a configure script use ./configure CC=icc


NOTE: If you get a libimf.so error like "file does not exists" while using sudo, you will need to write a bash script adding "source /opt/intel/Compiler/11.0/069/bin/iccvars.sh" and the program you are trying to run.