Index: uspace/app/fontedit/fontedit.c
===================================================================
--- uspace/app/fontedit/fontedit.c	(revision 20d0098517d095c5d2dc40ac64c967b69372d0cf)
+++ uspace/app/fontedit/fontedit.c	(revision 32066f212544b2a8c1b50acaa18a90c0e476d812)
@@ -51,5 +51,7 @@
 
 enum {
-	glyph_scale = 8
+	glyph_scale = 8,
+	glyph_orig_x = 100,
+	glyph_orig_y = 100
 };
 
@@ -102,12 +104,39 @@
 	pos_event_t *event = (pos_event_t *) data;
 	font_edit_t *fedit;
+	int x, y;
 
 	fedit = (font_edit_t *) widget_get_data(widget);
 
 	if (event->type == POS_PRESS) {
-		gfx_glyph_bmp_setpix(fedit->gbmp, event->hpos / glyph_scale,
-		    event->vpos / glyph_scale, 1);
+		x = gfx_coord_div_rneg((int)event->hpos - glyph_orig_x,
+		    glyph_scale);
+		y = gfx_coord_div_rneg((int)event->vpos - glyph_orig_y,
+		    glyph_scale);
+
+		printf("x=%d y=%d\n", x, y);
+		gfx_glyph_bmp_setpix(fedit->gbmp, x, y, 1);
 		font_edit_paint(fedit);
 	}
+}
+
+/** Convert glyph pixel coordinates to displayed rectangle.
+ *
+ * Since we upscale the glyph a pixel in the glyph corresponds to a rectangle
+ * on the screen.
+ *
+ * @param fedit Font editor
+ * @param x X coordinate in glyph
+ * @param y Y coordinate in glyph
+ * @param drect Place to store displayed rectangle coordinates
+ */
+static void font_edit_gpix_to_disp(font_edit_t *fedit, int x, int y,
+    gfx_rect_t *drect)
+{
+	(void) fedit;
+
+	drect->p0.x = glyph_orig_x + x * glyph_scale;
+	drect->p0.y = glyph_orig_y + y * glyph_scale;
+	drect->p1.x = glyph_orig_x + (x + 1) * glyph_scale;
+	drect->p1.y = glyph_orig_y + (y + 1) * glyph_scale;
 }
 
@@ -120,12 +149,9 @@
 	gfx_color_t *color = NULL;
 	gfx_rect_t rect;
+	gfx_rect_t grect;
 	errno_t rc;
-	int w, h;
 	int x, y;
 	int pix;
 
-	w = 50;
-	h = 50;
-
 	rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
 	if (rc != EOK)
@@ -136,14 +162,15 @@
 		goto error;
 
-	for (y = 0; y < h; y++) {
-		for (x = 0; x < w; x++) {
+	gfx_glyph_bmp_get_rect(fedit->gbmp, &grect);
+	printf("grect=%d,%d,%d,%d\n", grect.p0.x, grect.p0.y,
+	    grect.p1.x, grect.p1.y);
+
+	for (y = grect.p0.y; y < grect.p1.y; y++) {
+		for (x = grect.p0.x; x < grect.p1.x; x++) {
 			pix = gfx_glyph_bmp_getpix(fedit->gbmp, x, y);
 
-			rect.p0.x = x * glyph_scale;
-			rect.p0.y = y * glyph_scale;
-			rect.p1.x = (x + 1) * glyph_scale;
-			rect.p1.y = (y + 1) * glyph_scale;
-
 			if (pix != 0) {
+				font_edit_gpix_to_disp(fedit, x, y, &rect);
+
 				rc = gfx_fill_rect(fedit->gc, &rect);
 				if (rc != EOK)
@@ -154,4 +181,23 @@
 
 	gfx_color_delete(color);
+
+	/* Display glyph origin */
+
+	rc = gfx_color_new_rgb_i16(0, 0xffff, 0, &color);
+	if (rc != EOK)
+		goto error;
+
+	rc = gfx_set_color(fedit->gc, color);
+	if (rc != EOK)
+		goto error;
+
+	font_edit_gpix_to_disp(fedit, 0, 0, &rect);
+
+	rc = gfx_fill_rect(fedit->gc, &rect);
+	if (rc != EOK)
+		goto error;
+
+	gfx_color_delete(color);
+
 	return EOK;
 error:
Index: uspace/lib/gfx/include/gfx/coord.h
===================================================================
--- uspace/lib/gfx/include/gfx/coord.h	(revision 20d0098517d095c5d2dc40ac64c967b69372d0cf)
+++ uspace/lib/gfx/include/gfx/coord.h	(revision 32066f212544b2a8c1b50acaa18a90c0e476d812)
@@ -40,4 +40,5 @@
 #include <types/gfx/coord.h>
 
+extern gfx_coord_t gfx_coord_div_rneg(gfx_coord_t, gfx_coord_t);
 extern void gfx_coord2_add(gfx_coord2_t *, gfx_coord2_t *, gfx_coord2_t *);
 extern void gfx_coord2_subtract(gfx_coord2_t *, gfx_coord2_t *, gfx_coord2_t *);
Index: uspace/lib/gfx/src/coord.c
===================================================================
--- uspace/lib/gfx/src/coord.c	(revision 20d0098517d095c5d2dc40ac64c967b69372d0cf)
+++ uspace/lib/gfx/src/coord.c	(revision 32066f212544b2a8c1b50acaa18a90c0e476d812)
@@ -39,4 +39,25 @@
 #include <stddef.h>
 
+/** Divide @a a by @a b and round towards negative numbers.
+ *
+ * Regular integer division always rounds towards zero. This is not useful
+ * e.g. for scaling down, where we always need to round towards negative
+ * numbers.
+ *
+ * @param a Dividend
+ * @param b Divisor
+ * @return Quotient
+ */
+gfx_coord_t gfx_coord_div_rneg(gfx_coord_t a, gfx_coord_t b)
+{
+	if ((a > 0 && b > 0) || (a < 0 && b < 0)) {
+		/* Result is non-negative, round towards zero */
+		return a / b;
+	} else {
+		/* Result is negative, round away from zero */
+		return (a - b + 1) / b;
+	}
+}
+
 /** Add two vectors.
  *
Index: uspace/lib/gfxfont/include/gfx/glyph_bmp.h
===================================================================
--- uspace/lib/gfxfont/include/gfx/glyph_bmp.h	(revision 20d0098517d095c5d2dc40ac64c967b69372d0cf)
+++ uspace/lib/gfxfont/include/gfx/glyph_bmp.h	(revision 32066f212544b2a8c1b50acaa18a90c0e476d812)
@@ -45,4 +45,5 @@
 extern errno_t gfx_glyph_bmp_save(gfx_glyph_bmp_t *);
 extern void gfx_glyph_bmp_close(gfx_glyph_bmp_t *);
+extern void gfx_glyph_bmp_get_rect(gfx_glyph_bmp_t *, gfx_rect_t *);
 extern int gfx_glyph_bmp_getpix(gfx_glyph_bmp_t *, gfx_coord_t, gfx_coord_t);
 extern errno_t gfx_glyph_bmp_setpix(gfx_glyph_bmp_t *, gfx_coord_t,
Index: uspace/lib/gfxfont/src/glyph_bmp.c
===================================================================
--- uspace/lib/gfxfont/src/glyph_bmp.c	(revision 20d0098517d095c5d2dc40ac64c967b69372d0cf)
+++ uspace/lib/gfxfont/src/glyph_bmp.c	(revision 32066f212544b2a8c1b50acaa18a90c0e476d812)
@@ -165,4 +165,14 @@
 }
 
+/** Get rectangle covered by glyph bitmap.
+ *
+ * @param bmp Glyph bitmap
+ * @param rect Place to store rectangle
+ */
+void gfx_glyph_bmp_get_rect(gfx_glyph_bmp_t *bmp, gfx_rect_t *rect)
+{
+	*rect = bmp->rect;
+}
+
 /** Get pixel from glyph bitmap.
  *
