font-style: italic vs oblique in CSS

In the purest (type designer) sense, an oblique is a roman font that has been skewed a certain number of degrees (8-12 degrees, usually). An italic is created by the type designer with specific characters (notably lowercase a) drawn differently to create a more calligraphic, as well as slanted version. Some type foundries have arbitrarily … Read more

Password hint font in Android

Changing the typeface in xml didn’t work on the hint text for me either. I found two different solutions, the second of which has better behavior for me: 1) Remove android:inputType=”textPassword” from your xml file and instead, in set it in java: EditText password = (EditText) findViewById(R.id.password_text); password.setTransformationMethod(new PasswordTransformationMethod()); With this approach, the hint font … Read more

Proper MIME type for OTF fonts

There are a number of font formats that one can set MIME types for, on both Apache and IIS servers. I’ve traditionally had luck with the following: svg as “image/svg+xml” (W3C: August 2011) ttf as “application/x-font-ttf” (IANA: March 2013) or “application/x-font-truetype” otf as “application/x-font-opentype” (IANA: March 2013) woff as “application/font-woff” (IANA: January 2013) woff2 as … Read more

How to Set a Custom Font in the ActionBar Title?

You can do this using a custom TypefaceSpan class. It’s superior to the customView approach indicated above because it doesn’t break when using other Action Bar elements like expanding action views. The use of such a class would look something like this: SpannableString s = new SpannableString(“My Title”); s.setSpan(new TypefaceSpan(this, “MyTypeface.otf”), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); // … Read more

Valid values for android:fontFamily and what they map to?

Where do these values come from? The documentation for android:fontFamily does not list this information in any place These are indeed not listed in the documentation. But they are mentioned here under the section ‘Font families’. The document lists every new public API for Android Jelly Bean 4.1. In the styles.xml file in the application … Read more

How to host google web fonts on my own server?

Please keep in mind that my answer has aged a lot. There are other more technically sophisticated answers below, e.g.: neverpanic/google-font-download google-webfont-helper localfont so don’t let the fact that this is the currently accepted answer give you the impression that this is still the best one. You can also now also download google’s entire font … Read more

How to change the font on the TextView?

First, the default is not Arial. The default is Droid Sans. Second, to change to a different built-in font, use android:typeface in layout XML or setTypeface() in Java. Third, there is no Helvetica font in Android. The built-in choices are Droid Sans (sans), Droid Sans Mono (monospace), and Droid Serif (serif). While you can bundle … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)