Index: uspace/lib/gfxfont/private/tpf_file.h
===================================================================
--- uspace/lib/gfxfont/private/tpf_file.h	(revision 120031a5f4d9aa87b321353fc535d5224df0984a)
+++ uspace/lib/gfxfont/private/tpf_file.h	(revision 453f203b19d838dadf195f0ff067c546848ab1bf)
@@ -38,4 +38,6 @@
 #define _GFX_PRIVATE_TPF_FILE_H
 
+#include <stdint.h>
+
 enum {
 	/** Typeface RIFF format ID */
@@ -63,4 +65,50 @@
 };
 
+/** TPF font properties */
+typedef struct {
+	uint16_t size;
+	uint16_t flags;
+} tpf_font_props_t;
+
+/** TPF font metrics */
+typedef struct {
+	uint16_t ascent;
+	uint16_t descent;
+	uint16_t leading;
+} tpf_font_metrics_t;
+
+/** TPF glyph metrics */
+typedef struct {
+	uint16_t advance;
+} tpf_glyph_metrics_t;
+
+/** TPF glyph rectangle/origin */
+typedef struct {
+	/** Rectangle p0.x */
+	uint32_t p0x;
+	/** Rectangle p0.y */
+	uint32_t p0y;
+	/** Rectangle p1.x */
+	uint32_t p1x;
+	/** Rectangle p1.y */
+	uint32_t p1y;
+	/** Origin X */
+	uint32_t orig_x;
+	/** Origin Y */
+	uint32_t orig_y;
+} tpf_glyph_ror_t;
+
+/** TPF font bitmap header */
+typedef struct {
+	/** Width in pixels */
+	uint32_t width;
+	/** Height in pixels */
+	uint32_t height;
+	/** Format (0) */
+	uint16_t fmt;
+	/** Depth (bits/pixel) */
+	uint16_t depth;
+} tpf_font_bmp_hdr_t;
+
 #endif
 
Index: uspace/lib/gfxfont/src/font.c
===================================================================
--- uspace/lib/gfxfont/src/font.c	(revision 120031a5f4d9aa87b321353fc535d5224df0984a)
+++ uspace/lib/gfxfont/src/font.c	(revision 453f203b19d838dadf195f0ff067c546848ab1bf)
@@ -36,4 +36,5 @@
 #include <adt/list.h>
 #include <assert.h>
+#include <byteorder.h>
 #include <errno.h>
 #include <gfx/bitmap.h>
@@ -403,4 +404,5 @@
 	errno_t rc;
 	riff_rchunk_t propsck;
+	tpf_font_props_t tprops;
 	size_t nread;
 
@@ -409,6 +411,6 @@
 		return rc;
 
-	rc = riff_read(&propsck, (void *) props, sizeof(*props), &nread);
-	if (rc != EOK || nread != sizeof(*props))
+	rc = riff_read(&propsck, (void *) &tprops, sizeof(tprops), &nread);
+	if (rc != EOK || nread != sizeof(tprops))
 		return EIO;
 
@@ -416,4 +418,7 @@
 	if (rc != EOK)
 		return rc;
+
+	props->size = uint16_t_le2host(tprops.size);
+	props->flags = uint16_t_le2host(tprops.flags);
 
 	return EOK;
@@ -430,4 +435,8 @@
 	errno_t rc;
 	riff_wchunk_t propsck;
+	tpf_font_props_t tprops;
+
+	tprops.size = host2uint16_t_le(props->size);
+	tprops.flags = host2uint16_t_le(props->flags);
 
 	rc = riff_wchunk_start(riffw, CKID_fprp, &propsck);
@@ -435,5 +444,5 @@
 		return rc;
 
-	rc = riff_write(riffw, (void *) props, sizeof(*props));
+	rc = riff_write(riffw, (void *) &tprops, sizeof(tprops));
 	if (rc != EOK)
 		return rc;
@@ -457,4 +466,5 @@
 	errno_t rc;
 	riff_rchunk_t mtrck;
+	tpf_font_metrics_t tmetrics;
 	size_t nread;
 
@@ -463,6 +473,6 @@
 		return rc;
 
-	rc = riff_read(&mtrck, (void *) metrics, sizeof(*metrics), &nread);
-	if (rc != EOK || nread != sizeof(*metrics))
+	rc = riff_read(&mtrck, (void *) &tmetrics, sizeof(tmetrics), &nread);
+	if (rc != EOK || nread != sizeof(tmetrics))
 		return EIO;
 
@@ -471,4 +481,7 @@
 		return rc;
 
+	metrics->ascent = uint16_t_le2host(tmetrics.ascent);
+	metrics->descent = uint16_t_le2host(tmetrics.descent);
+	metrics->leading = uint16_t_le2host(tmetrics.leading);
 	return EOK;
 }
@@ -484,11 +497,16 @@
 {
 	errno_t rc;
+	tpf_font_metrics_t tmetrics;
 	riff_wchunk_t mtrck;
 
+	tmetrics.ascent = host2uint16_t_le(metrics->ascent);
+	tmetrics.descent = host2uint16_t_le(metrics->descent);
+	tmetrics.leading = host2uint16_t_le(metrics->leading);
+
 	rc = riff_wchunk_start(riffw, CKID_fmtr, &mtrck);
 	if (rc != EOK)
 		return rc;
 
-	rc = riff_write(riffw, (void *) metrics, sizeof(*metrics));
+	rc = riff_write(riffw, (void *) &tmetrics, sizeof(tmetrics));
 	if (rc != EOK)
 		return rc;
@@ -511,4 +529,5 @@
 	errno_t rc;
 	riff_rchunk_t bmpck;
+	tpf_font_bmp_hdr_t thdr;
 	gfx_bitmap_params_t params;
 	gfx_bitmap_alloc_t alloc;
@@ -516,5 +535,6 @@
 	uint32_t width;
 	uint32_t height;
-	uint32_t depth;
+	uint16_t fmt;
+	uint16_t depth;
 	size_t nread;
 
@@ -523,17 +543,14 @@
 		goto error;
 
-	rc = riff_read_uint32(&bmpck, &width);
-	if (rc != EOK)
-		goto error;
-
-	rc = riff_read_uint32(&bmpck, &height);
-	if (rc != EOK)
-		goto error;
-
-	rc = riff_read_uint32(&bmpck, &depth);
-	if (rc != EOK)
-		goto error;
-
-	if (depth != 8 * sizeof(uint32_t)) {
+	rc = riff_read(&bmpck, &thdr, sizeof(thdr), &nread);
+	if (rc != EOK || nread != sizeof(thdr))
+		goto error;
+
+	width = uint32_t_le2host(thdr.width);
+	height = uint32_t_le2host(thdr.height);
+	fmt = uint16_t_le2host(thdr.fmt);
+	depth = uint16_t_le2host(thdr.depth);
+
+	if (fmt != 0 || depth != 8 * sizeof(uint32_t)) {
 		rc = ENOTSUP;
 		goto error;
@@ -587,7 +604,13 @@
 {
 	errno_t rc;
+	tpf_font_bmp_hdr_t thdr;
 	riff_wchunk_t bmpck;
 	gfx_bitmap_alloc_t alloc;
 
+	thdr.width = host2uint32_t_le(font->rect.p1.x);
+	thdr.height = host2uint32_t_le(font->rect.p1.y);
+	thdr.fmt = 0;
+	thdr.depth = host2uint16_t_le(8 * sizeof(uint32_t));
+
 	rc = gfx_bitmap_get_alloc(font->bitmap, &alloc);
 	if (rc != EOK)
@@ -598,13 +621,5 @@
 		return rc;
 
-	rc = riff_write_uint32(riffw, font->rect.p1.x);
-	if (rc != EOK)
-		return rc;
-
-	rc = riff_write_uint32(riffw, font->rect.p1.y);
-	if (rc != EOK)
-		return rc;
-
-	rc = riff_write_uint32(riffw, 8 * sizeof(uint32_t));
+	rc = riff_write(riffw, &thdr, sizeof(thdr));
 	if (rc != EOK)
 		return rc;
Index: uspace/lib/gfxfont/src/glyph.c
===================================================================
--- uspace/lib/gfxfont/src/glyph.c	(revision 120031a5f4d9aa87b321353fc535d5224df0984a)
+++ uspace/lib/gfxfont/src/glyph.c	(revision 453f203b19d838dadf195f0ff067c546848ab1bf)
@@ -35,4 +35,5 @@
 
 #include <assert.h>
+#include <byteorder.h>
 #include <errno.h>
 #include <gfx/bitmap.h>
@@ -326,4 +327,5 @@
 	errno_t rc;
 	riff_rchunk_t mtrck;
+	tpf_glyph_metrics_t tmetrics;
 	size_t nread;
 
@@ -332,6 +334,6 @@
 		return rc;
 
-	rc = riff_read(&mtrck, (void *) metrics, sizeof(*metrics), &nread);
-	if (rc != EOK || nread != sizeof(*metrics))
+	rc = riff_read(&mtrck, (void *) &tmetrics, sizeof(tmetrics), &nread);
+	if (rc != EOK || nread != sizeof(tmetrics))
 		return EIO;
 
@@ -340,4 +342,5 @@
 		return rc;
 
+	metrics->advance = uint16_t_le2host(tmetrics.advance);
 	return EOK;
 }
@@ -353,11 +356,14 @@
 {
 	errno_t rc;
+	tpf_glyph_metrics_t tmetrics;
 	riff_wchunk_t mtrck;
 
+	tmetrics.advance = host2uint16_t_le(metrics->advance);
+
 	rc = riff_wchunk_start(riffw, CKID_gmtr, &mtrck);
 	if (rc != EOK)
 		return rc;
 
-	rc = riff_write(riffw, (void *) metrics, sizeof(*metrics));
+	rc = riff_write(riffw, (void *) &tmetrics, sizeof(tmetrics));
 	if (rc != EOK)
 		return rc;
@@ -466,4 +472,5 @@
 {
 	errno_t rc;
+	tpf_glyph_ror_t tror;
 	riff_rchunk_t rorck;
 	size_t nread;
@@ -473,18 +480,19 @@
 		return rc;
 
-	rc = riff_read(&rorck, (void *) &glyph->rect, sizeof(glyph->rect),
+	rc = riff_read(&rorck, (void *) &tror, sizeof(tror),
 	    &nread);
-	if (rc != EOK || nread != sizeof(glyph->rect))
+	if (rc != EOK || nread != sizeof(tror))
 		return EIO;
 
-	rc = riff_read(&rorck, (void *) &glyph->origin, sizeof(glyph->origin),
-	    &nread);
-	if (rc != EOK || nread != sizeof(glyph->origin))
-		return EIO;
-
 	rc = riff_rchunk_end(&rorck);
 	if (rc != EOK)
 		return rc;
 
+	glyph->rect.p0.x = uint32_t_le2host(tror.p0x);
+	glyph->rect.p0.y = uint32_t_le2host(tror.p0y);
+	glyph->rect.p1.x = uint32_t_le2host(tror.p1x);
+	glyph->rect.p1.y = uint32_t_le2host(tror.p1y);
+	glyph->origin.x = uint32_t_le2host(tror.orig_x);
+	glyph->origin.y = uint32_t_le2host(tror.orig_y);
 	return EOK;
 }
@@ -500,15 +508,19 @@
 {
 	errno_t rc;
+	tpf_glyph_ror_t tror;
 	riff_wchunk_t rorck;
 
+	tror.p0x = host2uint32_t_le(glyph->rect.p0.x);
+	tror.p0y = host2uint32_t_le(glyph->rect.p0.y);
+	tror.p1x = host2uint32_t_le(glyph->rect.p1.x);
+	tror.p1y = host2uint32_t_le(glyph->rect.p1.y);
+	tror.orig_x = host2uint32_t_le(glyph->origin.x);
+	tror.orig_y = host2uint32_t_le(glyph->origin.y);
+
 	rc = riff_wchunk_start(riffw, CKID_gror, &rorck);
 	if (rc != EOK)
 		return rc;
 
-	rc = riff_write(riffw, (void *) &glyph->rect, sizeof(glyph->rect));
-	if (rc != EOK)
-		return rc;
-
-	rc = riff_write(riffw, (void *) &glyph->origin, sizeof(glyph->origin));
+	rc = riff_write(riffw, (void *) &tror, sizeof(tror));
 	if (rc != EOK)
 		return rc;
