Index: uspace/lib/gfxfont/test/glyph.c
===================================================================
--- uspace/lib/gfxfont/test/glyph.c	(revision d2100e23b019a7ed116b6d3d17c17625196dc4f7)
+++ uspace/lib/gfxfont/test/glyph.c	(revision 06b8383847ae4de1f2e464710f9877a9fbea7bc9)
@@ -32,4 +32,5 @@
 #include <gfx/glyph.h>
 #include <gfx/glyph_bmp.h>
+#include <gfx/typeface.h>
 #include <io/pixelmap.h>
 #include <pcut/pcut.h>
@@ -75,26 +76,33 @@
 PCUT_TEST(create_destroy)
 {
-	gfx_font_metrics_t fmetrics;
-	gfx_font_t *font;
-	gfx_glyph_metrics_t gmetrics;
-	gfx_glyph_t *glyph;
-	gfx_context_t *gc;
-	test_gc_t tgc;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_glyph_metrics_init(&gmetrics);
-	rc = gfx_glyph_create(font, &gmetrics, &glyph);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_glyph_destroy(glyph);
-
-	gfx_font_destroy(font);
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
+	gfx_font_t *font;
+	gfx_glyph_metrics_t gmetrics;
+	gfx_glyph_t *glyph;
+	gfx_context_t *gc;
+	test_gc_t tgc;
+	errno_t rc;
+
+	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_glyph_metrics_init(&gmetrics);
+	rc = gfx_glyph_create(font, &gmetrics, &glyph);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_glyph_destroy(glyph);
+
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -104,5 +112,7 @@
 PCUT_TEST(get_metrics)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics;
@@ -116,6 +126,12 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -131,5 +147,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -139,5 +156,7 @@
 PCUT_TEST(set_metrics)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics1;
@@ -152,6 +171,10 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -172,5 +195,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -180,17 +204,23 @@
 PCUT_TEST(set_pattern)
 {
-	gfx_font_metrics_t fmetrics;
-	gfx_font_t *font;
-	gfx_glyph_metrics_t gmetrics;
-	gfx_glyph_t *glyph;
-	gfx_context_t *gc;
-	test_gc_t tgc;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
+	gfx_font_t *font;
+	gfx_glyph_metrics_t gmetrics;
+	gfx_glyph_t *glyph;
+	gfx_context_t *gc;
+	test_gc_t tgc;
+	errno_t rc;
+
+	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -215,5 +245,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -223,17 +254,23 @@
 PCUT_TEST(clear_pattern)
 {
-	gfx_font_metrics_t fmetrics;
-	gfx_font_t *font;
-	gfx_glyph_metrics_t gmetrics;
-	gfx_glyph_t *glyph;
-	gfx_context_t *gc;
-	test_gc_t tgc;
-	errno_t rc;
-
-	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
+	gfx_font_t *font;
+	gfx_glyph_metrics_t gmetrics;
+	gfx_glyph_t *glyph;
+	gfx_context_t *gc;
+	test_gc_t tgc;
+	errno_t rc;
+
+	rc = gfx_context_new(&test_ops, (void *) &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -261,5 +298,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -269,5 +307,7 @@
 PCUT_TEST(matches)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics;
@@ -282,6 +322,10 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -315,5 +359,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -323,5 +368,7 @@
 PCUT_TEST(first_next_pattern)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics;
@@ -335,6 +382,10 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -360,5 +411,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -368,5 +420,7 @@
 PCUT_TEST(pattern_str)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics;
@@ -381,6 +435,10 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -406,5 +464,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -414,5 +473,7 @@
 PCUT_TEST(transfer)
 {
-	gfx_font_metrics_t fmetrics;
+	gfx_font_props_t fprops;
+	gfx_font_metrics_t fmetrics;
+	gfx_typeface_t *tface;
 	gfx_font_t *font;
 	gfx_glyph_metrics_t gmetrics;
@@ -431,6 +492,10 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
-	gfx_font_metrics_init(&fmetrics);
-	rc = gfx_font_create(gc, &fmetrics, &font);
+	rc = gfx_typeface_create(gc, &tface);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	gfx_font_props_init(&fprops);
+	gfx_font_metrics_init(&fmetrics);
+	rc = gfx_font_create(tface, &fprops, &fmetrics, &font);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -498,5 +563,6 @@
 	gfx_glyph_destroy(glyph);
 
-	gfx_font_destroy(font);
+	gfx_font_close(font);
+	gfx_typeface_destroy(tface);
 	rc = gfx_context_delete(gc);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
