shadow: initial font rendering
[platform/upstream/freerdp.git] / server / shadow / shadow_font.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Implementation
3  *
4  * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef FREERDP_SHADOW_SERVER_FONT_H
20 #define FREERDP_SHADOW_SERVER_FONT_H
21
22 #include <freerdp/server/shadow.h>
23
24 #include <winpr/crt.h>
25 #include <winpr/synch.h>
26 #include <winpr/image.h>
27
28 struct rdp_shadow_glyph
29 {
30         int width;
31         int offsetX;
32         int offsetY;
33         int rectX;
34         int rectY;
35         int rectWidth;
36         int rectHeight;
37         BYTE code[4];
38 };
39 typedef struct rdp_shadow_glyph rdpShadowGlyph;
40
41 struct rdp_shadow_font
42 {
43         int size;
44         int height;
45         char* family;
46         char* style;
47         wImage* image;
48         int glyphCount;
49         rdpShadowGlyph* glyphs;
50 };
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56 int shadow_font_draw_text(rdpShadowSurface* surface, int nXDst, int nYDst, rdpShadowFont* font, const char* text);
57 int shadow_font_draw_glyph(rdpShadowSurface* surface, int nXDst, int nYDst, rdpShadowFont* font, rdpShadowGlyph* glyph);
58
59 rdpShadowFont* shadow_font_new(const char* path, const char* file);
60 void shadow_font_free(rdpShadowFont* font);
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif /* FREERDP_SHADOW_SERVER_FONT_H */