added struct subsys so that we know each
[winnie] / src / text.cc
index c58924f..7dbae5d 100644 (file)
@@ -1,9 +1,31 @@
+/*
+winnie - an experimental window system
+
+Copyright (C) 2013 Eleni Maria Stea
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Author: Eleni Maria Stea <elene.mst@gmail.com>
+*/
+
 #include <ft2build.h>
 #include <freetype/freetype.h>
 
 #include "gfx.h"
 #include "shalloc.h"
 #include "text.h"
+#include "winnie.h"
 
 #define DPI 72
 #define FONT_PATH "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf"
@@ -26,6 +48,8 @@ bool init_text()
                return false;
        }
 
+       get_subsys()->text_offset = (int)((char*)text - (char*)get_pool());
+
        if(FT_Init_FreeType(&text->ft_lib)) {
                fprintf(stderr, "Failed to initialize the FreeType library!\n");
                return false;