Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to change custom font to bold italic in java

public class MainActivity extends AppCompatActivity {

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

        Typeface font = Typeface.createFromAsset(getAssets(), "fonts/bebas_neue_regular.ttf");

        TextView tvNormal = (TextView) findViewById(R.id.normal);
        tvNormal.setTypeface(font);

        TextView tvBold = (TextView) findViewById(R.id.bold);
        tvBold.setTypeface(font, Typeface.BOLD);

        TextView tvItalic = (TextView) findViewById(R.id.italic);
        tvItalic.setTypeface(font, Typeface.ITALIC);


        TextView tvBoth = (TextView) findViewById(R.id.boldItalic);
        tvBoth.setTypeface(font, Typeface.BOLD_ITALIC);
    }
}
Comment

java font bold italic

Font plainFont = new Font("Arial", 0, 10); // PLAIN
Font boldFont = new Font("Arial", Font.Bold, 10); // BOLD
Font italicFont = new Font("Arial", Font.Italic, 10); // ITALIC
Font boldItalicFont = new Font("Arial", Font.Bold + Font.Italic, 10); // BOLD and ITALIC
Comment

PREVIOUS NEXT
Code Example
Java :: get sum of int array and return string 
Java :: style jbuttons 
Java :: coin flip in java 
Java :: /bin/sh 1 java not found docker 
Java :: what are the chances that i pass this coming up test 
Java :: jgit clone in memory 
Java :: grepper mcm java 
Java :: spring amqp exchange not found 
Java :: ciclo for para percorere duas listas java 
Sql :: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 
Sql :: uninstall mysql ubuntu 
Sql :: postgres get columns names 
Sql :: mysql add user with all privileges 
Sql :: sql ignore accents 
Sql :: mysql group_concat distinct 
Sql :: alter table column change data type to text mysql 
Sql :: display all databases 
Sql :: how to export database mysql terminal ubuntu 
Sql :: query to list all tables in sql database 
Sql :: sql server version query 
Sql :: mysql add column if not exists 
Sql :: run postgres with docker 
Sql :: sql drop schema 
Sql :: sqlite3 now 
Sql :: revoke a role from user microsoft sql server 
Sql :: oracle list dblink 
Sql :: psql view enum values 
Sql :: bulk kill mysql processlist 
Sql :: stop psql server windows 
Sql :: SELECT User,Host FROM mysql.user; 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =