 +
 +#endif
 diff --git a/source/html/html-font.c b/source/html/html-font.c
-index d319a462..49ac58df 100644
+index d319a462..df823fa0 100644
 --- a/source/html/html-font.c
 +++ b/source/html/html-font.c
-@@ -3,6 +3,47 @@
- 
+@@ -1,8 +1,50 @@
+ #include "mupdf/fitz.h"
+ #include "html-imp.h"
+ 
++#include <stdlib.h>
  #include <string.h>
  
 +char *

 		const unsigned char *data;
 		int size;
 
@@ -23,6 +65,14 @@ fz_load_html_default_font(fz_context *ctx, fz_html_font_set *set, const char *fa
 			fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load html font: %s", real_family);
 		set->fonts[idx] = fz_new_font_from_memory(ctx, NULL, data, size, 0, 1);
 		fz_font_flags(set->fonts[idx])->is_serif = !is_sans;
+#else
+		char * filename = html_lookup_substitute_font_from_file(ctx, family, is_mono, !is_sans, is_bold, is_italic);
+		if (!filename)
+			fz_throw(ctx, FZ_ERROR_GENERIC, "cannot load html font");
+
+		set->fonts[idx] = fz_new_font_from_file(ctx, NULL, filename, 0, 1);
+		fz_font_flags(set->fonts[idx])->is_serif = !is_sans;
+#endif
 	}
 	return set->fonts[idx];
 }
@@ -73,7 +123,7 @@ fz_load_html_font(fz_context *ctx, fz_html_font_set *set, const char *family, in
 		return font;
 	}
 

 
 		fontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, 0, 1);
+#else
+		char *filename = fz_lookup_base14_font_from_file(ctx, clean_name);
+		if (!filename)
+			fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin font: '%s'", fontname);
+
