Archive for 'Fonts'

Customizing Android Fonts – Text Shadow

You can use three different attributes to customize the appearance of your text shadow:

android:shadowColor Shadow color in the same format as textColor.

android:shadowRadius Radius of the shadow specified as a floating point number.

android:shadowDx The shadow’s horizontal offset specified as a floating point number.

android:shadowDy The shadow’s vertical offset specified as a floating point number.

The floating point numbers don’t have a specific unit – they are merely arbitrary factors.

<TextView

android:layout_width=”fill_parent”

android:layout_height=”wrap_content”

android:text=”A light blue shadow.”

android:shadowColor=”#00ccff”

android:shadowRadius=”1.5″

android:shadowDx=”1″

android:shadowDy=”1″

/>

Customizing Android Fonts – Typeface

 

There are three different default typefaces which are known as the Droid family of fonts: sans, monospace and serif. You can specify any one of them as the value for the android:typeface attribute in the XML declaration of a component that supports text styling, such as TextView. Here’s an example of all three typefaces in action:

<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
              android:orientation="vertical"  
             android:layout_width="fill_parent"  
             android:layout_height="fill_parent"  
        >  
   <TextView  
           android:layout_width="fill_parent"  
          android:layout_height="wrap_content"  
           android:text="This is a 'sans' demo!"  
            android:typeface="sans"  
          />  
     <TextView  
            android:layout_width="fill_parent"  
           android:layout_height="wrap_content"  
           android:text="This is a 'serif' demo!"  
           android:typeface="serif"  
         />  
    <TextView  
            android:layout_width="fill_parent"  
           android:layout_height="wrap_content"  
           android:text="This is a 'monospace' demo!"  
           android:typeface="monospace"  
           />  
</LinearLayout>  

Built in fonts

<?

$im  = ImageCreate(175,125);

$white = ImageColorAllocate($im,255,255,255);

$black = ImageColorAllocate($im,0,0,0);

ImageString($im,1,10,20,"Font 1: ABCdef",$black);

ImageString($im,2,10,35,"Font 2: ABCdef",$black);

mageString($im,3,10,53,"Font 3: ABCdef",$black);

ImageString($im,4,10,70,"Font 4: ABCdef",$black);

ImageString($im,5,10,90,"Font 5:ABCdef",$black);

ImageStringUp($im,5,150,118,"Vertical Text",$black);

Header('Content-Type: image/png');ImagePNG($im);

?>

We Can Build Your App for You. Lets Get Started !