summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html/en/drv/sim.html8
-rw-r--r--html/en/history.html4
-rw-r--r--src/sim/sim_text.c18
3 files changed, 28 insertions, 2 deletions
diff --git a/html/en/drv/sim.html b/html/en/drv/sim.html
index 85a4e7f..0e69d9d 100644
--- a/html/en/drv/sim.html
+++ b/html/en/drv/sim.html
@@ -1,4 +1,4 @@
-<html>
+<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
@@ -85,6 +85,12 @@
Narrow Bold=ARIALNB&quot;. &quot;Type Face&quot; is not case sensitive.</li>
</ul>
+<ul>
+ <li>&quot;<strong>FREETYPEVERSION</strong>&quot;: Returns a version string
+ with the current Freetype library being used, in the format &quot;FreeType
+ &lt;major&gt;.&lt;minor&gt;.&lt;patch&gt;&quot;.</li>
+</ul>
+
</body>
</html>
diff --git a/html/en/history.html b/html/en/history.html
index 7a993cd..5d85069 100644
--- a/html/en/history.html
+++ b/html/en/history.html
@@ -19,7 +19,7 @@
<body>
<h2>History of Changes</h2>
-<h3>CVS (02/Dec/2009)</h3>
+<h3>CVS (15/Dec/2009)</h3>
<ul>
<li><span style="color: #0000FF">New:</span> driver SVG.</li>
<li><span style="color: #0000FF">New:</span> function <strong>
@@ -32,6 +32,8 @@
&quot;PDFLIBVERSION&quot;,
&quot;SUBJECT&quot;,&quot;TITLE&quot;,&quot;CREATOR&quot;,&quot;AUTHOR&quot;,&quot;KEYWORDS&quot; attributes for the PDF
driver.</li>
+ <li><span style="color: #0000FF">New:</span>
+ &quot;FREETYPEVERSION&quot; attribute for the Simulation base driver.</li>
<li><span class="style1">Changed</span><span class="hist_changed">:</span>
Freetype updated to version 2.3.11.</li>
<li><span class="style1">Changed</span><span class="hist_changed">:</span>
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)