Skip to main content

Posts

Showing posts with the label font

Using Font in CSS

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;} ...

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

See more Android Tutorials here....... Faster Loading images in GridViews or ListViews 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; ...

Using external font in ANDROID

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);