Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Vincenzo Marzano. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * Vincenzo Marzano - initial API and implementation ******************************************************************************/ import android.graphics.Typeface; import android.widget.TextView; public class Main { public static void setFont(TextView t, String font) { Typeface type = Typeface.createFromAsset(t.getContext().getAssets(), font); t.setTypeface(type); } }