summaryrefslogtreecommitdiff
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
parentd576fbeadc7f52a0b7c63ba0793f8bdcceccc15b (diff)
New: "FREETYPEVERSION" attribute for the Simulation base driver.
-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)