54 |
jint *metrics; |
jint *metrics; |
55 |
struct peerfont *pf = NULL; |
struct peerfont *pf = NULL; |
56 |
FT_Matrix mat; |
FT_Matrix mat; |
57 |
|
double pointsize; |
58 |
|
FT_Face face; |
59 |
|
|
60 |
pf = NSA_GET_FONT_PTR(env, font); |
pf = NSA_GET_FONT_PTR(env, font); |
61 |
g_assert (pf != NULL); |
g_assert (pf != NULL); |
70 |
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0)) |
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0)) |
71 |
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0) |
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0) |
72 |
|
|
73 |
double pointsize = pango_font_description_get_size (pf->desc); |
pointsize = pango_font_description_get_size (pf->desc); |
74 |
pointsize /= (double) PANGO_SCALE; |
pointsize /= (double) PANGO_SCALE; |
75 |
|
|
76 |
mat.xx = DOUBLE_TO_16_16(1); |
mat.xx = DOUBLE_TO_16_16(1); |
78 |
mat.yx = DOUBLE_TO_16_16(0); |
mat.yx = DOUBLE_TO_16_16(0); |
79 |
mat.yy = DOUBLE_TO_16_16(1); |
mat.yy = DOUBLE_TO_16_16(1); |
80 |
|
|
81 |
FT_Face face = pango_ft2_font_get_face (pf->font); |
face = pango_ft2_font_get_face (pf->font); |
82 |
FT_Set_Transform(face, &mat, NULL); |
FT_Set_Transform(face, &mat, NULL); |
83 |
FT_Set_Char_Size( face, |
FT_Set_Char_Size( face, |
84 |
DOUBLE_TO_26_6 (pointsize), |
DOUBLE_TO_26_6 (pointsize), |