seed r124 - trunk/examples



Author: racarr
Date: Wed Nov  5 11:10:57 2008
New Revision: 124
URL: http://svn.gnome.org/viewvc/seed?rev=124&view=rev

Log:
Add pango fontset example, queries fontsets on system and prints. Needs 
to be worked in to pango example (Tim!).


Added:
   trunk/examples/pango-fontset.js   (contents, props changed)
Modified:
   trunk/examples/Makefile.am

Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am	(original)
+++ trunk/examples/Makefile.am	Wed Nov  5 11:10:57 2008
@@ -12,6 +12,7 @@
 	mini-browser.js \
 	n-oscillator.js \
 	notify-test.js \
+	pango-fontset.js \
 	pango.js \
 	quine.js \
 	repl.js \

Added: trunk/examples/pango-fontset.js
==============================================================================
--- (empty file)
+++ trunk/examples/pango-fontset.js	Wed Nov  5 11:10:57 2008
@@ -0,0 +1,19 @@
+#!/usr/local/bin/seed
+
+Seed.import_namespace("Pango");
+Seed.import_namespace("PangoFT2");
+
+context = new Pango.Context();
+description = Pango.FontDescription._new();
+description.set_family("");
+
+fontmap = new PangoFT2.FontMap();
+fontset = fontmap.load_fontset(context, 
+			       description, 
+			       Pango.language_get_default());
+fontset.foreach(
+		function(fontset, font)
+		{
+		    description = font.describe();
+		    Seed.print(description.get_family());
+		});
\ No newline at end of file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]