Tampilkan postingan dengan label font. Tampilkan semua postingan
Tampilkan postingan dengan label font. Tampilkan semua postingan

Using Font in CSS

Posted by Unknown Rabu, 06 November 2013 0 komentar
Font family [font-family]
The property font-family is used to set a prioritized list of fonts to be used to display a given element or web page.
 
h1 {font-family: arial, verdana, sans-serif;}
h2 {font-family: "Times New Roman", serif;}
Font style [font-style]
The property font-style defines the chosen font either in normal, italic or oblique.
 
h2 {font-family: "Times New Roman", serif; font-style: italic;}
Font variant [font-variant]
The property font-variant is used to choose between normal or small-caps variants of a font. A small-caps font is a font that uses smaller sized capitalized letters (upper case) instead of lower case letters.
 
h1 {font-variant: small-caps;}
h2 {font-variant: normal;}
Font weight [font-weight]
The property font-weight describes how bold or "heavy" a font should be presented. A font can either be normal or bold.
 
h1 {font-family: arial, verdana, sans-serif; font-weight: bold;}
h2 {font-family: arial, verdana, sans-serif; font-weight: normal;}
Font size [font-size]
The size of a font is set by the property font-size.
There are many different units (e.g. pixels and percentages) to choose from to describe font sizes.
 
h1 {font-size: 30px;}
h2 {font-size: 12pt;}
h3 {font-size: 120%;}
p {font-size: 1em;}
Compiling [font]
Using the font short hand property it is possible to cover all the different font properties in one single property.
   
p {
font-style: italic;
font-weight: bold;
font-size: 30px;
font-family: arial, sans-serif;
}
The above one can be rewritten as
 
p {
font: italic bold 30px arial, sans-serif;
}

Baca Selengkapnya ....

Spannable String in Android - URL Span ,Clickable Span, Rich-Style Formatting of Textview .....

Posted by Unknown Jumat, 14 Juni 2013 0 komentar
See more Android Tutorials here.......
Spannable brings lots of possibility to TextView, includes displaying various appearance of a Text and onClick callbak.
The SpannableString class allows you to easily format certain pieces which are called spans of a string, by applying CharacterStyle ie,color, font, ormake it a link .
Here is an example where, explained how to use spannable string to give font size, color, linking a text via clickable span and through URL Span and to strike through the text.
Lets go through the example :
import android.os.Bundle;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.URLSpan;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.TextView.BufferType;
import android.app.Activity;
import android.graphics.Color;

public class Spannable_String extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_spannable__string);

TextView spannabletextview = (TextView)findViewById(R.id.usage);

//********* Simple Span to color text ************//
// this is the text that we going to work on
SpannableString text = new SpannableString("Iam an example for spannable string ");
// make "Iam" (characters 0 to 3) green
text.setSpan(new ForegroundColorSpan(Color.BLUE), 0, 3, 0);
// Put the SpannableString in textview

//**** Relative Span to change text relative to others ****//
//changing the text from 5 to 9 1.5f bigger than textview size
text.setSpan(new RelativeSizeSpan(1.5f), 5, 9, 0);

//************ Clickable Span **************//
// going to make "for" a clickable text and bring a toast
ClickableSpan clickfor = new ClickableSpan() {

@Override
public void onClick(View widget) {
Toast.makeText(Spannable_String.this, "hello clicked for", Toast.LENGTH_LONG).show();
}
};
text.setSpan(clickfor, 15, 18, 0);

//******** Strike through text***********//
text.setSpan(new StrikethroughSpan(), 9, 14, 0);
//******** URL Span *********************//
text.setSpan(new URLSpan("http://eazyprogramming.blogspot.in/"), 22, 26, 0);
//******** ForegroundColor *********************//
text.setSpan(new ForegroundColorSpan(Color.GREEN), 22, 26, 0);
// make our ClickableSpans and URLSpans work
spannabletextview.setMovementMethod(LinkMovementMethod.getInstance());

spannabletextview.setText(text, BufferType.SPANNABLE);
}

}


Baca Selengkapnya ....

Using external font in ANDROID

Posted by Unknown Selasa, 12 Maret 2013 0 komentar
    

TextView text =(TextView) findViewById(R.id.textview);
Typeface face;
face = Typeface.createFromAsset(getAssets(), "AMAZB.TTF");
text.setTypeface(face);
text.setTextSize(30);
text.setTextColor(Color.WHITE);

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.