대개 폰트파일에는 16비트 정수 grid 좌표로 point가 저장되며, grid의 원점은 0,0에서 시작된다. 따라서 -16384 ~ 16383의 범위를 가진다. 원점은 대게 좌하단에 위치함. ( windows의 GDI좌표와는 다름 ).
pixel_size = point_size * resolution / 72
pixel_coord = grid_coord * pixel_size / EM_size
통상 EM size는 2048임 ( 폰트 디자이너가 가상으로 정한 박스크기 )
* 최외곽 윤곽선은 시계방향
* 내부 윤곽선은 반시계방향.
typedef struct FT_Outline_
{
short n_contours; /* number of contours in glyph */
short n_points; /* number of points in the glyph */
FT_Vector* points; /* the outline's points */
char* tags; /* the points flags */
short* contours; /* the contour end points */
int flags; /* outline masks */
} FT_Outline;
|
항목 |
n_contours |
윤곽선 갯수. |
n_points |
총 정점 수. |
points |
FT_Vector 타입으로 구성된 n_points개의 정점 배열. |
tags |
n_points개로 된 배열 개별 정점의 타입을 규정. 0번째 비트는 Bézier 제어점인지 아닌지를 나타냄. 제어점이면 1.
1번째 비트는 a third-order Bézier arc control point인지를 나타냄. 이게 off이면 a second-order control point 라는 의미임. |
contours |
이것는 short형의 n_contous 개의 배열. outline의 각 윤곽선의 마지막 점을 나타냄. 첫번째 윤곽선은 0번째 정점에서 contours[0]번째 정점까지임. 두번째 윤곽선은 contours[0]+1 에서 contours[1]까지. |
flags |
A set of bit flags used to characterize the outline and give hints to the scan-converter and hinter on how to convert/grid-fit it. See FT_OUTLINE_FLAGS. | |