FreeType2 Library 의 Glyph Metrics 의 수치는 26.6 pixel 포맷으로 이루어져 있다.
(1/64th of pixels) 단위로 표현된다.
실제로 FT_Glyph_Metrics_ 구조체를 들여다 보면
typedef long FT_POS ;
typedef struct FT_Glyph_Metrics_
{
FT_POS width;
...
} FT_Glyph_Metrics;
long 은 4byte 32bit 이다.
26.6 pixel 포맷은
32bit 중 앞의 26bit 는 정수단위 나머지 6bit 는 부동소수점 단위를 표현하기 위한것..
좀더 정확한 수치 표현을 위해 이러한 방식을 사용하고 있다..
뒤의 소수점 6자리는 (2^6 = 64)
즉 1/64 단위까지 표현할 수 있다는 것이다.
따라서 pixel 값을 얻으려면..
6비트 땡기면 된다.
lWidth = pMetrics->width >> 6;
'Programming' 카테고리의 다른 글
| freetype dxfont 간 성능 비교.. (0) | 2008/01/23 |
|---|---|
| STL Vector (0) | 2008/01/22 |
| hash string (0) | 2008/01/18 |
| Texture Stage Argument (0) | 2008/01/18 |
| FreeType2 library ft_pixel_mode_mono (0) | 2008/01/18 |
| FreeType2 Library Metrics pixel 포맷 (0) | 2008/01/18 |
| freetype library (0) | 2007/12/14 |
| rand(), srand(), RAND_MAX (0) | 2007/11/10 |
| 맵핑이란.. Mapping (0) | 2007/10/05 |
| ID3DXSprite::Begin (0) | 2007/10/02 |
| D3DXCreateSprite (0) | 2007/09/30 |
TAG freetype






댓글을 달아 주세요