summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorscuri <scuri>2009-12-15 19:54:03 +0000
committerscuri <scuri>2009-12-15 19:54:03 +0000
commit130c513d903cc7d3d67f9fcb82d9b1a964cf0f08 (patch)
tree427da8c29bd9dff7e3c42c25b9dc863d9ad89707 /src/sim
parentd576fbeadc7f52a0b7c63ba0793f8bdcceccc15b (diff)
New: "FREETYPEVERSION" attribute for the Simulation base driver.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/sim_text.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sim/sim_text.c b/src/sim/sim_text.c
index f543269..b8df98f 100644
--- a/src/sim/sim_text.c
+++ b/src/sim/sim_text.c
@@ -69,12 +69,30 @@ static cdAttribute addfontmap_attrib =
NULL
};
+static char* get_version_attrib(cdCtxCanvas* ctxcanvas)
+{
+ static char version[50];
+ FT_Int major, minor, patch;
+ cdCanvas* canvas = ((cdCtxCanvasBase*)ctxcanvas)->canvas;
+ FT_Library_Version(canvas->simulation->tt_text->library, &major, &minor, &patch);
+ sprintf(version, "FreeType %d.%d.%d", major, minor, patch);
+ return version;
+}
+
+static cdAttribute version_attrib =
+{
+ "FREETYPEVERSION",
+ NULL,
+ get_version_attrib
+};
+
void cdSimInitText(cdSimulation* simulation)
{
if (!simulation->tt_text)
simulation->tt_text = cdTT_create();
cdRegisterAttribute(simulation->canvas, &addfontmap_attrib);
+ cdRegisterAttribute(simulation->canvas, &version_attrib);
}
static const char* find_font_filename(cdSimulation* simulation, const char* name)