반응형
안드로이드에선 TTF 또는 OTF (True Type or Open TypeFace, a TTF extension) 설치해서 사용할 수 있다.
Android:typeface 속성 : "normal","sans","serif","monospace"
- Project의 assets 하위로 fonts 폴더를 만들고 폰트를 설치
- 폰트를 사용할 View 선택
- Typeface object 생성(Typeface class static method create())
- setTypeface method.
Typeface 생성함수
- create(String familyName, int style);
- create(TypeFace family, inst style);
- createFromAsset(AssetManager mgr, String path);
- createFromFile(File path);
-
createFromFile(String path);
TextView v = (TextView) findViewById(R.id.FontView); // 1
Typeface t = Typeface.createFromAsset(getAssets(),"fonts/fontdemo.ttf");// 2
v.setTypeface(t, Typeface.BOLD_ITALIC); // 3
반응형
'Programming > Android' 카테고리의 다른 글
네이버 맵 안드로이드에서 사용하기 (0) | 2014.06.28 |
---|---|
안드로이드 서비스 실행 (다른 App 구동할 때) (0) | 2014.04.25 |
[android] Custom MediaPlayerControl 처리 예 (0) | 2014.02.18 |
파일명 소문자로 일괄 변경 배치 (0) | 2013.12.17 |
Android SharedPreferences 암호화 랩퍼 (0) | 2013.12.17 |