Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 102 lines (92 sloc) 1.974 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
#define PERL_NO_GET_CONTEXT
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "imext.h"
#include "imperl.h"
#include "imw32.h"

DEFINE_IMAGER_CALLBACKS;

MODULE = Imager::Font::W32 PACKAGE = Imager::Font::W32

void
i_wf_bbox(face, size, text_sv, utf8=0)
const char *face
i_img_dim size
SV *text_sv
int utf8
      PREINIT:
i_img_dim cords[BOUNDING_BOX_COUNT];
        int rc, i;
char const *text;
         STRLEN text_len;
      PPCODE:
        text = SvPV(text_sv, text_len);
#ifdef SvUTF8
        if (SvUTF8(text_sv))
          utf8 = 1;
#endif
        if (rc = i_wf_bbox(face, size, text, text_len, cords, utf8)) {
          EXTEND(SP, rc);
          for (i = 0; i < rc; ++i)
            PUSHs(sv_2mortal(newSViv(cords[i])));
        }

undef_int
i_wf_text(face, im, tx, ty, cl, size, text_sv, align, aa, utf8 = 0)
const char *face
Imager::ImgRaw im
i_img_dim tx
i_img_dim ty
Imager::Color cl
i_img_dim size
SV *text_sv
int align
int aa
  int utf8
      PREINIT:
char const *text;
STRLEN text_len;
      CODE:
        text = SvPV(text_sv, text_len);
#ifdef SvUTF8
        if (SvUTF8(text_sv))
          utf8 = 1;
#endif
RETVAL = i_wf_text(face, im, tx, ty, cl, size, text, text_len,
align, aa, utf8);
      OUTPUT:
RETVAL

undef_int
i_wf_cp(face, im, tx, ty, channel, size, text_sv, align, aa, utf8 = 0)
const char *face
Imager::ImgRaw im
i_img_dim tx
i_img_dim ty
int channel
i_img_dim size
SV *text_sv
int align
int aa
int utf8
      PREINIT:
char const *text;
STRLEN text_len;
      CODE:
        text = SvPV(text_sv, text_len);
#ifdef SvUTF8
        if (SvUTF8(text_sv))
          utf8 = 1;
#endif
RETVAL = i_wf_cp(face, im, tx, ty, channel, size, text, text_len,
align, aa, utf8);
      OUTPUT:
RETVAL

undef_int
i_wf_addfont(font)
        char *font

undef_int
i_wf_delfont(font)
        char *font


BOOT:
PERL_INITIALIZE_IMAGER_CALLBACKS;
Something went wrong with that request. Please try again.