added gfxfilter for merging fonts
[swftools.git] / lib / filters / remove_font_transforms.c
1 /* remove_font_transform.c
2
3    Part of the swftools package.
4
5    Copyright (c) 2010 Matthias Kramm <kramm@quiss.org> 
6  
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
20
21 #include <stdlib.h>
22 #include <memory.h>
23 #include "../gfxfilter.h"
24 #include "../gfxtools.h"
25 #include "../types.h"
26 #include "../mem.h"
27
28 typedef struct _internal {
29 } internal_t;
30
31 static void pass1_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out)
32 {
33     internal_t*i = (internal_t*)f->internal;
34     out->drawchar(out, font, glyphnr, color, matrix);
35 }
36
37 static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out)
38 {
39     internal_t*i = (internal_t*)f->internal;
40     out->drawchar(out, font, glyphnr, color, matrix);
41 }
42
43 void gfxtwopassfilter_remove_font_transforms_init(gfxtwopassfilter_t*f)
44 {
45     internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t));
46     memset(f, 0, sizeof(gfxtwopassfilter_t));
47     f->type = gfxfilter_twopass;
48     f->pass1.name = "remove font transforms pass 1";
49     f->pass1.drawchar = pass1_drawchar;
50     f->pass1.internal = i;
51
52     f->pass2.name = "remove font transforms pass 2";
53     f->pass2.drawchar = pass2_drawchar;
54     f->pass2.internal = i;
55 }
56