Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to load font in java

try {
  
    Font font = Font.createFont(Font.TRUETYPE_FONT,
                                new File("./Fonts/AyyBoyyy.ttf"));
    Font bold = font.deriveFont(Font.BOLD, 12);
	Font plain = font.deriveFont(Font.PLAIN, 12);
  
} catch (FontFormatException | IOException e) {
  e.printStackTrace();
}
Comment

use custom font java

try {
     GraphicsEnvironment ge = 
         GraphicsEnvironment.getLocalGraphicsEnvironment();
     ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf")));
} catch (IOException|FontFormatException e) {
     //Handle exception
}
Comment

PREVIOUS NEXT
Code Example
Java :: java radnom 
Java :: for loop in multidimensional array java 
Java :: java calculate elapsedTime 
Java :: Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt 
Java :: big screen jframe 
Java :: android studio allow http 
Java :: how to take input in java 
Java :: java send an image over a socket 
Java :: How to find the fibonacci of an integer value iteratively in Java? 
Java :: java cast bolean to int 
Java :: java declare multilayred array values 
Java :: removeAll hard code 
Java :: java font 
Java :: k combinations for range 1 through n 
Java :: java double 2 decimal 
Java :: turn off focus border java 
Java :: java Date get today date 
Java :: how to restart activity in android 
Java :: java loop through string 
Java :: how to make a bot to wait in jda 
Java :: how to add animation to nivation component android 
Java :: spring data rest format date 
Java :: java get keys from tree map 
Java :: Traversing a double dimensional array 
Java :: java only close socket outputstream 
Java :: error: package androidx.multidex does not exist 
Java :: java input character 
Java :: how to solve simultaneous equations in mathematica 
Java :: javafx filechooser specific file 
Java :: anagram java program 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =