|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.kwis.msp.lcdui.Font
글꼴 클래스 입니다.
문자열을 찍는데 사용되는 문자를 나타내는 글꼴 클래스입니다.
getFont
를 사용해서 원하는 폰트를 가져옵니다.
기본적으로 getFont
를 해서 가져온
폰트는 내부적으로 공유하므로 자원을 프리해야할 필요는 없습니다.
getFont
함수로 가져와서
Graphics.setFont(org.kwis.msp.lcdui.Font)
함수를
통해서 폰트를 지정하여 문자의 화면 출력 외형을 변경할 수 있습니다.
getFont
를 통해서 시스템에 따라서,
지정한 폰트가 아닌 그와 유사한 폰트를 돌려 받을 수 있습니다.
문자열의 화면 출력 길이를 알기 위해서는 stringWidth
나
substringWidth
함수를 사용합니다.
폰트의 스타일은 다음중 하나가 됩니다.
STYLE_PLAIN
STYLE_UNDERLINED
STYLE_BOLD
STYLE_BOLD | STYLE_UNDERLINED
STYLE_ITALIC
STYLE_ITALIC | STYLE_UNDERLINED
STYLE_BOLD | STYLE_ITALIC
STYLE_BOLD | STYLE_ITALIC | STYLE_UNDERLINED
Field Summary | |
protected int |
face
|
static int |
FACE_MONOSPACE
Monospace폰트 페이스. |
static int |
FACE_PROPORTIONAL
Proportional폰트 페이스. |
static int |
FACE_SYSTEM
System 폰트 페이스. |
protected int |
size
|
static int |
SIZE_LARGE
큰 크기의 폰트 크기. |
static int |
SIZE_MEDIUM
중간 크기의 폰트 크기. |
static int |
SIZE_SMALL
작은 크기의 폰트 크기. |
protected int |
style
|
static int |
STYLE_BOLD
진한 폰트 스타일. |
static int |
STYLE_ITALIC
기운 폰트 스타일. |
static int |
STYLE_PLAIN
보통 폰트 스타일. |
static int |
STYLE_UNDERLINED
밑줄 그은 폰트 스타일. |
Method Summary | |
int |
charsWidth(char[] ch,
int offset,
int length)
문자열의 화면상의 폭을 넘겨줍니다. |
int |
charWidth(char ch)
문자의 화면상의 폭을 넘겨 줍니다. |
int |
getBaselinePosition()
문자의 베이스 라인(base line) 높이를 돌려줍니다. |
static Font |
getDefaultFont()
시스템의 기본 폰트를 돌려줍니다. |
int |
getFace()
폰트의 페이스를 돌려줍니다. |
static Font |
getFont(int face,
int style,
int size)
특정 폰트를 얻어 옵니다. |
int |
getHeight()
폰트의 높이를 얻어옵니다. |
int |
getSize()
폰트의 크기를 얻어 옵니다. |
int |
getStyle()
폰트의 스타일을 얻어 옵니다. |
boolean |
isBold()
폰트의 스타일을 STYLE_BOLD 인지 아닌지 여부를 돌려줍니다. |
boolean |
isItalic()
폰트의 스타일을 STYLE_ITALIC 인지 아닌지 여부를 돌려줍니다. |
boolean |
isPlain()
폰트의 스타일을 STYLE_PLAIN 인지 아닌지 여부를 돌려줍니다. |
boolean |
isUnderlined()
폰트의 스타일을 STYLE_UNDERLINED 인지
아닌지 여부를 돌려줍니다. |
int |
stringWidth(String str)
문자열의 폭을 얻어 옵니다. |
int |
substringWidth(String str,
int offset,
int len)
문자열의 일부의 폭을 얻어 옵니다. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int FACE_MONOSPACE
public static int FACE_PROPORTIONAL
public static int FACE_SYSTEM
public static int SIZE_LARGE
public static int SIZE_MEDIUM
public static int SIZE_SMALL
public static int STYLE_BOLD
public static int STYLE_ITALIC
public static int STYLE_PLAIN
public static int STYLE_UNDERLINED
protected int style
protected int size
protected int face
Method Detail |
public static Font getFont(int face, int style, int size)
face
- 폰트의 face; FACE_MONOSPACE
,
FACE_PROPORTIONAL
,
FACE_SYSTEM
과 같은 값이 올 수 있음style
- 폰트 스타일; STYLE_PLAIN
이나
STYLE_ITALIC
,
STYLE_BOLD
,
STYLE_UNDERLINED
의 조합이 올 수 있음.size
- 폰트 크기; SIZE_LARGE
,
SIZE_MEDIUM
, SIZE_SMALL
중 하나가
올 수 있음IllegalArgumentException
- face
, style
,
size
중에 하나라도 유효한 값을 가지지 않는 경우.public int charsWidth(char[] ch, int offset, int length)
ch
가 가르키는
문자 배열의 offset
부터 시작해서
length
개 까지의 문자가 됩니다.ch
- 문자 배열offset
- 문자 배열에서의 위치length
- 문자 갯수ArrayIndexOutOfBoundException
- offset값과 length가 문자
어레이의 범위를 벗어나는 경우NullPointerException
- ch가 null인 경우public int charWidth(char ch)
ch
가 나타내는 문자의 화면상의 픽셀 단위의 폭을 넘겨줍니다.
만일 시스템이 지원하지 않는 문자라면 ' '(0x20)의 폭을 넘겨줍니다.
물론 화면에 출력시에도 ' '가 출력됩니다.ch
- 문자public int getBaselinePosition()
public static Font getDefaultFont()
public int getFace()
FACE_MONOSPACE
,
FACE_PROPORTIONAL
, FACE_SYSTEM
중의
하나가 됩니다.public int getHeight()
public int getSize()
public int getStyle()
STYLE_BOLD
,
STYLE_ITALIC
, STYLE_UNDERLINE
,
STYLE_PLAIN
의 값을 OR한 값을 돌려줍니다.public boolean isBold()
STYLE_BOLD
인지 아닌지 여부를 돌려줍니다.STYLE_BOLD
이면
true
그렇지 않으면
false
public boolean isItalic()
STYLE_ITALIC
인지 아닌지 여부를 돌려줍니다.STYLE_ITALIC
이면
true
그렇지 않으면 false
public boolean isPlain()
STYLE_PLAIN
인지 아닌지 여부를 돌려줍니다.STYLE_PLAIN
이면 true
그렇지 않으면 false
public boolean isUnderlined()
STYLE_UNDERLINED
인지
아닌지 여부를 돌려줍니다.STYLE_UNDERLINED
이면
true
그렇지 않으면 false
public int stringWidth(String str)
str
가 지정하는 문자열의 화면에 출력시 폭을 얻어 옵니다.str
- 폭을 계산할 문자열NullPointerException
- str이 null
인 경우.public int substringWidth(String str, int offset, int len)
str
가 지정하는 문자열의 offset
부터
len
개의 문자의 폭을 얻어 옵니다.str
- 폭을 계산할 문자열offset
- 문자열의 시작 점len
- 문자열의 문자 갯수StringIndexOutOfBoundsException
- offset
과
len
값이 문자열의 범위를 벗어나는 경우NullPointerException
- str이 null
인 경우.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AromaSoft Corp. Proprietary and Confidential
(C)opyright 2003 AromaSoft Corp. All right reserved.
Contact : contact@aromasoft.com