| 1 |
#define PERL_NO_GET_CONTEXT |
| 2 |
#ifdef __cplusplus |
| 3 |
extern "C" { |
| 4 |
#endif |
| 5 |
#include "EXTERN.h" |
| 6 |
#include "perl.h" |
| 7 |
#include "XSUB.h" |
| 8 |
#include "imext.h" |
| 9 |
#include "imperl.h" |
| 10 |
#include "imw32.h" |
| 11 |
|
| 12 |
DEFINE_IMAGER_CALLBACKS; |
| 13 |
|
| 14 |
MODULE = Imager::Font::W32 PACKAGE = Imager::Font::W32 |
| 15 |
|
| 16 |
void |
| 17 |
i_wf_bbox(face, size, text_sv, utf8=0) |
| 18 |
const char *face |
| 19 |
i_img_dim size |
| 20 |
SV *text_sv |
| 21 |
int utf8 |
| 22 |
PREINIT: |
| 23 |
i_img_dim cords[BOUNDING_BOX_COUNT]; |
| 24 |
int rc, i; |
| 25 |
char const *text; |
| 26 |
STRLEN text_len; |
| 27 |
PPCODE: |
| 28 |
text = SvPV(text_sv, text_len); |
| 29 |
#ifdef SvUTF8 |
| 30 |
if (SvUTF8(text_sv)) |
| 31 |
utf8 = 1; |
| 32 |
#endif |
| 33 |
if ((rc = i_wf_bbox(face, size, text, text_len, cords, utf8)) != 0) { |
| 34 |
EXTEND(SP, rc); |
| 35 |
for (i = 0; i < rc; ++i) |
| 36 |
PUSHs(sv_2mortal(newSViv(cords[i]))); |
| 37 |
} |
| 38 |
|
| 39 |
undef_int |
| 40 |
i_wf_text(face, im, tx, ty, cl, size, text_sv, align, aa, utf8 = 0) |
| 41 |
const char *face |
| 42 |
Imager::ImgRaw im |
| 43 |
i_img_dim tx |
| 44 |
i_img_dim ty |
| 45 |
Imager::Color cl |
| 46 |
i_img_dim size |
| 47 |
SV *text_sv |
| 48 |
int align |
| 49 |
int aa |
| 50 |
int utf8 |
| 51 |
PREINIT: |
| 52 |
char const *text; |
| 53 |
STRLEN text_len; |
| 54 |
CODE: |
| 55 |
text = SvPV(text_sv, text_len); |
| 56 |
#ifdef SvUTF8 |
| 57 |
if (SvUTF8(text_sv)) |
| 58 |
utf8 = 1; |
| 59 |
#endif |
| 60 |
RETVAL = i_wf_text(face, im, tx, ty, cl, size, text, text_len, |
| 61 |
align, aa, utf8); |
| 62 |
OUTPUT: |
| 63 |
RETVAL |
| 64 |
|
| 65 |
undef_int |
| 66 |
i_wf_cp(face, im, tx, ty, channel, size, text_sv, align, aa, utf8 = 0) |
| 67 |
const char *face |
| 68 |
Imager::ImgRaw im |
| 69 |
i_img_dim tx |
| 70 |
i_img_dim ty |
| 71 |
int channel |
| 72 |
i_img_dim size |
| 73 |
SV *text_sv |
| 74 |
int align |
| 75 |
int aa |
| 76 |
int utf8 |
| 77 |
PREINIT: |
| 78 |
char const *text; |
| 79 |
STRLEN text_len; |
| 80 |
CODE: |
| 81 |
text = SvPV(text_sv, text_len); |
| 82 |
#ifdef SvUTF8 |
| 83 |
if (SvUTF8(text_sv)) |
| 84 |
utf8 = 1; |
| 85 |
#endif |
| 86 |
RETVAL = i_wf_cp(face, im, tx, ty, channel, size, text, text_len, |
| 87 |
align, aa, utf8); |
| 88 |
OUTPUT: |
| 89 |
RETVAL |
| 90 |
|
| 91 |
undef_int |
| 92 |
i_wf_addfont(font) |
| 93 |
char *font |
| 94 |
|
| 95 |
undef_int |
| 96 |
i_wf_delfont(font) |
| 97 |
char *font |
| 98 |
|
| 99 |
|
| 100 |
BOOT: |
| 101 |
PERL_INITIALIZE_IMAGER_CALLBACKS; |