You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by chaitanya krishna <ch...@gmail.com> on 2008/05/12 15:01:50 UTC

How to use font files in hadoop

Hi,

  I have a font file with .ttf extension which is being used well in Java by
using the following code:


public void getFont(String fontfile, String text)
    {
        Font font;
        try
        {
            FileInputStream fis = new FileInputStream(fontfile);
            font = Font.createFont(Font.TRUETYPE_FONT, fis);
            font = font.deriveFont(72);
         }
        catch(Exception ioe)
        {
            ioe.printStackTrace();
        }
    }

I tried to cast FileInputStream into some compatible object in hadoop like
FSDataInputStream, but couldn't do so..

Is there any way to handle a given font file and get its properties in
hadoop?

Thank you.