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

java set font

Font f = new Font("Arial", Font.BOLD, 12);
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 ::  
::  
::  
::  
::  
::  
:: what is deserialization in java 
Java :: lopping rows rethinkdb 
::  
Java ::  
::  
::  
::  
::  
Java :: coin flip random java 
Java ::  
Java ::  
::  
::  
::  
Java ::  
Java ::  
::  
:: @Bean public ModelMapper modelMapper() { ModelMapper modelMapper = new ModelMapper(); modelMapper.getConfiguration() .setMatchingStrategy(MatchingStrategies.STRICT); } 
::  
::  
Java ::  
Java ::  
ADD CONTENT
Topic
Content
Source link
Name
1+8 =