… | |
… | |
34 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
34 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
35 | OUTPUT: |
35 | OUTPUT: |
36 | RETVAL |
36 | RETVAL |
37 | |
37 | |
38 | void |
38 | void |
39 | add_font (char *file) |
39 | set_font (char *file) |
40 | CODE: |
40 | CODE: |
41 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); |
|
|
42 | |
|
|
43 | void |
|
|
44 | set_font (char *pango_font) |
|
|
45 | CODE: |
|
|
46 | { |
41 | { |
|
|
42 | int count; |
|
|
43 | FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)file, 0, 0, &count); |
|
|
44 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ |
47 | PangoFontDescription *font = pango_font_description_from_string (pango_font); |
45 | PangoFontDescription *font = pango_fc_font_description_from_pattern (pattern); |
|
|
46 | FcPatternDestroy (pattern); |
48 | pango_context_set_font_description (context, font); |
47 | pango_context_set_font_description (context, font); |
49 | } |
48 | } |
50 | |
49 | |
51 | void |
50 | void |
52 | font_render (SV *text_, int height = 10) |
51 | font_render (SV *text_, int height = 10) |