1 | #ifdef _WIN32 |
1 | #ifdef _WIN32 |
|
|
2 | # define _WIN32_WINNT 0x0500 // needed to get win2000 api calls |
2 | # include <malloc.h> |
3 | # include <malloc.h> |
|
|
4 | # include <windows.h> |
3 | # pragma warning(disable:4244) |
5 | # pragma warning(disable:4244) |
4 | #endif |
6 | #endif |
5 | |
7 | |
6 | #include "EXTERN.h" |
8 | #include "EXTERN.h" |
7 | #include "perl.h" |
9 | #include "perl.h" |
… | |
… | |
81 | |
83 | |
82 | static void |
84 | static void |
83 | substitute_func (FcPattern *pattern, gpointer data) |
85 | substitute_func (FcPattern *pattern, gpointer data) |
84 | { |
86 | { |
85 | FcPatternAddBool (pattern, FC_HINTING , 1); |
87 | FcPatternAddBool (pattern, FC_HINTING , 1); |
86 | FcPatternAddBool (pattern, FC_AUTOHINT, 0); |
88 | FcPatternAddBool (pattern, FC_AUTOHINT, 1); |
87 | } |
89 | } |
88 | |
90 | |
89 | static void |
91 | static void |
90 | layout_update_font (CFClient__Layout self) |
92 | layout_update_font (CFClient__Layout self) |
91 | { |
93 | { |
… | |
… | |
404 | # undef const_iv |
406 | # undef const_iv |
405 | }; |
407 | }; |
406 | |
408 | |
407 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
409 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
408 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
410 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
|
|
411 | } |
409 | |
412 | |
|
|
413 | void |
|
|
414 | pango_init () |
|
|
415 | CODE: |
|
|
416 | { |
|
|
417 | // delayed, so it can pick up new fonts added by AddFontResourceEx |
410 | ft2_fontmap = pango_ft2_font_map_new (); |
418 | ft2_fontmap = pango_ft2_font_map_new (); |
411 | pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)ft2_fontmap, substitute_func, 0, 0); |
419 | pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)ft2_fontmap, substitute_func, 0, 0); |
412 | ft2_context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)ft2_fontmap); |
420 | ft2_context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)ft2_fontmap); |
413 | |
421 | |
414 | cairo_fontmap = pango_cairo_font_map_get_default (); |
422 | cairo_fontmap = pango_cairo_font_map_get_default (); |
415 | cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap); |
423 | cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap); |
416 | } |
424 | } |
417 | |
425 | |
418 | int |
426 | int |
419 | SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO) |
427 | SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO) |
420 | |
428 | |
… | |
… | |
559 | |
567 | |
560 | void |
568 | void |
561 | add_font (char *file) |
569 | add_font (char *file) |
562 | CODE: |
570 | CODE: |
563 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ |
571 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ |
|
|
572 | #ifdef _WIN32 |
|
|
573 | // cairo... sigh... requires win2000 |
|
|
574 | AddFontResourceEx (file, FR_PRIVATE, 0); |
|
|
575 | #endif |
564 | |
576 | |
565 | void |
577 | void |
566 | load_image_inline (SV *image_) |
578 | load_image_inline (SV *image_) |
567 | ALIAS: |
579 | ALIAS: |
568 | load_image_file = 1 |
580 | load_image_file = 1 |