diff -pru dillo/src/html.c dillo.new/src/html.c
--- dillo/src/html.c	Thu Sep 27 14:21:26 2001
+++ dillo.new/src/html.c	Sat Sep 29 18:34:00 2001
@@ -385,6 +385,47 @@ static void Html_set_top_font(DilloHtml 
    HTML_SET_TOP_ATTR (html, font, a_Dw_style_font_new (&font_attrs));
 }
 
+/* The following array of font sizes has to be _strictly_ crescent */
+#define DILLO_HTML_FONT_SIZES {8, 10, 12, 14, 18, 24}
+#define DILLO_HTML_NUM_FONTS        6
+#define DILLO_HTML_FONT_NORMALSIZE   2
+
+/* 
+ * Given a font_size, this will return the correct 'level'.
+ * (or the closest, if the exact level isn't found).
+ */
+static gint Html_fontsize_to_level(gint fontsize)
+{
+   gint sizes[] = DILLO_HTML_FONT_SIZES;
+   gdouble normalized_size, approximation = sizes[DILLO_HTML_NUM_FONTS-1] + 1;
+   gint level = 0, i;
+   
+   normalized_size = fontsize/prefs.font_factor;
+   
+   for (i = 0; i < DILLO_HTML_NUM_FONTS; i++)
+      if (normalized_size == sizes[i])
+	 return i;
+      else if (approximation >= fabs(normalized_size - sizes[i]) ) {
+	 approximation = fabs(normalized_size - sizes[i]);
+	 level = i;
+      }
+
+   return level;
+}
+
+/* 
+ * Given a level of a font, this will return the correct 'size'.
+ */
+static gint Html_level_to_fontsize(gint level)
+{
+   gint sizes[] = DILLO_HTML_FONT_SIZES;
+   
+   level = MAX(0, level);
+   level = MIN(DILLO_HTML_NUM_FONTS-1, level);
+   
+   return rint(sizes[level]*prefs.font_factor);
+}
+
 /*
  * Miscelaneous initializations for a DwPage
  */
@@ -405,7 +446,7 @@ static void Html_set_dwpage(DilloHtml *h
 
    /* Create a dummy font, attribute, and tag for the bottom of the stack. */
    font.name = PageFonts[0]; /* Helvetica */
-   font.size = rint(12.0 * prefs.font_factor);
+   font.size = Html_level_to_fontsize(DILLO_HTML_FONT_NORMALSIZE);
    font.bold = FALSE;
    font.italic = FALSE;
 
@@ -1327,18 +1368,12 @@ static void Html_tag_open_tr(DilloHtml *
  */
 static void Html_tag_open_h(DilloHtml *html, char *tag, gint tagsize)
 {
-   gint level;
-   gint sizes[] = {24, 18, 18, 14, 12, 10};
-   gdouble fontsize;
-
    Html_par_push_tag(html, tag, tagsize);
 
-   level = tag[2] - '0';
-   level = MAX(1, level);
-   level = MIN(6, level);
-   fontsize = sizes[level - 1];
-   fontsize *= prefs.font_factor;
-   Html_set_top_font(html, "helvetica", rint(fontsize), 1, 3);
+   Html_set_top_font(html, "helvetica", 
+		     Html_level_to_fontsize(DILLO_HTML_NUM_FONTS - 
+					    (tag[2] - '0')),
+		     1, 3);
 
    /* First finalize unclosed H tags (we test if already named anyway) */
    a_Menu_pagemarks_set_text(html->bw, html->Stash->str);
@@ -1357,6 +1392,24 @@ static void Html_tag_close_h(DilloHtml *
    a_Dw_page_parbreak(DW_PAGE (html->dw), 9);
 }
 
+/* 
+ *  Render <big> && <small> tags
+ */ 
+static void Html_tag_open_big_small(DilloHtml *html, char *tag, gint tagsize)
+{
+   gint level;
+   DwPage *page;
+
+   Html_push_tag(html, tag, tagsize);
+   page = (DwPage *) html->dw;
+
+   level = 
+      Html_fontsize_to_level(html->stack[html->stack_top].style->font->size);
+   level += ( (g_strncasecmp(tag+1, "big", 3)) ? -1 : 1);
+
+   Html_set_top_font(html, NULL, Html_level_to_fontsize(level), 0, 0);
+}
+
 /*
  * <BR>
  */
@@ -3150,7 +3203,7 @@ static const TagInfo Tags[] = {
   {"area", Html_tag_open_area, Html_tag_close_nop},
   {"b", Html_tag_open_b, Html_tag_close_default},
   {"base", Html_tag_open_base, Html_tag_close_nop},
-  /* big */
+  {"big", Html_tag_open_big_small, Html_tag_close_default},
   {"blockquote", Html_tag_open_blockquote, Html_tag_close_par},
   {"body", Html_tag_open_body, Html_tag_close_default},
   {"br", Html_tag_open_br, Html_tag_close_nop},
@@ -3208,7 +3261,7 @@ static const TagInfo Tags[] = {
   {"samp", Html_tag_open_samp, Html_tag_close_default},
   {"script", Html_tag_open_script, Html_tag_close_script},
   {"select", Html_tag_open_select, Html_tag_close_select},
-  /* small */
+  {"small", Html_tag_open_big_small, Html_tag_close_default},
   /* span */
   {"strike", Html_tag_open_strike, Html_tag_close_default},
   {"strong", Html_tag_open_strong, Html_tag_close_default},

