์ด ํ๋ก์ ํธ๋ ์๋์ฐ์ ๋งฅOS์์ ๋ชจ๋ ์ ์ ํ ํ๊ตญ์ด ํฐํธ๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก ํฌ๋ก์ค ํ๋ซํผ ํฐํธ ํธํ์ฑ์ ์ง์ํฉ๋๋ค.
org.javateam11.ClassroomReservation.util.FontUtils ํด๋์ค๋ ์ด์์ฒด์ ์ ๋ฐ๋ผ ์ ์ ํ ํ๊ตญ์ด ํฐํธ๋ฅผ ์๋์ผ๋ก ์ ํํฉ๋๋ค.
- ๋ง์ ๊ณ ๋ (Windows)
- Malgun Gothic (Windows ์๋ฌธ๋ช )
- Apple SD Gothic Neo (macOS)
- Apple Gothic (macOS ๊ตฌ๋ฒ์ )
- Noto Sans CJK KR (Linux)
- NanumGothic (๋์)
- Dialog (์์คํ ๊ธฐ๋ณธ)
import org.javateam11.ClassroomReservation.util.FontUtils;
// ๊ธฐ๋ณธ ํฐํธ ์ฌ์ฉ
Font titleFont = FontUtils.getTitleFont(); // 20pt, BOLD
Font labelFont = FontUtils.getLabelFont(); // 14pt, PLAIN
Font buttonFont = FontUtils.getButtonFont(); // 14pt, BOLD
Font plainFont = FontUtils.getPlainFont(); // 14pt, PLAIN
Font smallFont = FontUtils.getSmallFont(); // 12pt, PLAIN
// ์ฌ์ฉ์ ์ ์ ํฐํธ
Font customFont = FontUtils.getCustomFont(Font.ITALIC, 16);๋ณ๊ฒฝ ์ :
titleLabel.setFont(new Font("๋ง์ ๊ณ ๋", Font.BOLD, 20));๋ณ๊ฒฝ ํ:
titleLabel.setFont(FontUtils.getTitleFont());- Windows: ๋ง์ ๊ณ ๋ ์ฌ์ฉ
- macOS: Apple SD Gothic Neo ์ฌ์ฉ
- Linux: Noto Sans CJK KR ๋๋ NanumGothic ์ฌ์ฉ
- ํฌ๋ก์ค ํ๋ซํผ ํธํ์ฑ: ์ด์์ฒด์ ๋ณ๋ก ์ต์ ์ ํฐํธ ์๋ ์ ํ
- ์ฑ๋ฅ ์ต์ ํ: ํฐํธ ๊ฒ์ ๊ฒฐ๊ณผ ์บ์ฑ์ผ๋ก ์ฑ๋ฅ ํฅ์
- ์ ์ง๋ณด์์ฑ: ์ค์ํ๋ ํฐํธ ๊ด๋ฆฌ๋ก ์ผ๊ด์ฑ ์ ์ง
- ํ์ฅ์ฑ: ์๋ก์ด ํฐํธ๋ ์ด์์ฒด์ ์ง์ ์ฝ๊ฒ ์ถ๊ฐ ๊ฐ๋ฅ
ํ์ฌ ์ฌ์ฉ์ค์ธ ํฐํธ๋ฅผ ํ์ธํ๋ ค๋ฉด:
String currentFont = FontUtils.getCurrentFontName();
System.out.println("ํ์ฌ ํฐํธ: " + currentFont);- ํฐํธ ๋ณ๊ฒฝ ์ ์ ํ๋ฆฌ์ผ์ด์ ์ฌ์์ ํ์
- ์์คํ ์ ํ๊ตญ์ด ํฐํธ๊ฐ ์๋ ๊ฒฝ์ฐ ๊ธฐ๋ณธ Dialog ํฐํธ ์ฌ์ฉ
- ํฐํธ ์ด๋ฆ์ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ๋ฏ๋ก ์ ํํ ์ ๋ ฅํด์ผ ํจ