… | |
… | |
185 | |
185 | |
186 | static void |
186 | static void |
187 | layout_update_font (DC__Layout self) |
187 | layout_update_font (DC__Layout self) |
188 | { |
188 | { |
189 | /* use a random scale factor to account for unknown descenders, 0.8 works |
189 | /* use a random scale factor to account for unknown descenders, 0.8 works |
190 | * reasonably well with bitstream vera |
190 | * reasonably well with dejavu/bistream fonts |
191 | */ |
191 | */ |
192 | PangoFontDescription *font = self->font ? self->font : default_font; |
192 | PangoFontDescription *font = self->font ? self->font : default_font; |
193 | |
193 | |
194 | pango_font_description_set_absolute_size (font, |
194 | pango_font_description_set_absolute_size (font, |
195 | MAX (MIN_FONT_HEIGHT, self->base_height) * (PANGO_SCALE * 8 / 10)); |
195 | MAX (MIN_FONT_HEIGHT, self->base_height) * (PANGO_SCALE * 8 / 10)); |
… | |
… | |
673 | CODE: |
673 | CODE: |
674 | { |
674 | { |
675 | opengl_fontmap = pango_opengl_font_map_new (); |
675 | opengl_fontmap = pango_opengl_font_map_new (); |
676 | pango_opengl_font_map_set_default_substitute ((PangoOpenGLFontMap *)opengl_fontmap, substitute_func, 0, 0); |
676 | pango_opengl_font_map_set_default_substitute ((PangoOpenGLFontMap *)opengl_fontmap, substitute_func, 0, 0); |
677 | opengl_context = pango_opengl_font_map_create_context ((PangoOpenGLFontMap *)opengl_fontmap); |
677 | opengl_context = pango_opengl_font_map_create_context ((PangoOpenGLFontMap *)opengl_fontmap); |
|
|
678 | /*pango_context_set_font_description (opengl_context, default_font);*/ |
678 | #if PANGO_VERSION_CHECK (1, 15, 2) |
679 | #if PANGO_VERSION_CHECK (1, 15, 2) |
679 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
680 | pango_context_set_language (opengl_context, pango_language_from_string ("en")); |
680 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
681 | /*pango_context_set_base_dir (opengl_context, PANGO_DIRECTION_WEAK_LTR);*/ |
681 | #endif |
682 | #endif |
682 | } |
683 | } |
… | |
… | |
770 | SDL_GetKeyName (int sym) |
771 | SDL_GetKeyName (int sym) |
771 | |
772 | |
772 | int |
773 | int |
773 | SDL_GetAppState () |
774 | SDL_GetAppState () |
774 | |
775 | |
|
|
776 | int |
|
|
777 | SDL_GetModState () |
|
|
778 | |
775 | void |
779 | void |
776 | poll_events () |
780 | poll_events () |
777 | PPCODE: |
781 | PPCODE: |
778 | { |
782 | { |
779 | SDL_Event ev; |
783 | SDL_Event ev; |
… | |
… | |
912 | } |
916 | } |
913 | } |
917 | } |
914 | #endif |
918 | #endif |
915 | } |
919 | } |
916 | |
920 | |
917 | void |
921 | int |
918 | add_font (char *file) |
922 | add_font (char *file) |
919 | CODE: |
923 | CODE: |
920 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); |
924 | RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file); |
|
|
925 | OUTPUT: |
|
|
926 | RETVAL |
921 | |
927 | |
922 | void |
928 | void |
923 | load_image_inline (SV *image_) |
929 | load_image_inline (SV *image_) |
924 | ALIAS: |
930 | ALIAS: |
925 | load_image_file = 1 |
931 | load_image_file = 1 |