  		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
+@@ -23,6 +66,18 @@ 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);
++		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_mono = is_mono;
++		fz_font_flags(set->fonts[idx])->is_bold = is_bold;
++		fz_font_flags(set->fonts[idx])->is_italic = is_italic;
 +		fz_font_flags(set->fonts[idx])->is_serif = !is_sans;
++		free(filename);
 +#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
+@@ -73,7 +128,7 @@ fz_load_html_font(fz_context *ctx, fz_html_font_set *set, const char *family, in
  		return font;
  	}
  

 		const unsigned char *data;
 		int len;
 		int index;
@@ -410,8 +475,15 @@ pdf_load_substitute_cjk_font(fz_context *ctx, pdf_font_desc *fontdesc, const cha
 		if (!data)
 			fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin CJK font");
 
-		/* A glyph bbox cache is too big for CJK fonts. */
 		fontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, index, 0);
+#else
+		char * filename = fz_lookup_cjk_font_from_file(ctx, ros, serif, fontdesc->wmode);
+		if (!filename)
+			fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin CJK font");
+

 	$(XPS_OBJ) \
 	$(SVG_OBJ) \
diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h
index ef4cd74d..6e6ea124 100644
--- a/include/mupdf/fitz/font.h
+++ b/include/mupdf/fitz/font.h
@@ -624,4 +624,9 @@ void fz_hb_lock(fz_context *ctx);
 */
 void fz_hb_unlock(fz_context *ctx);
 
+char *get_font_file(char *name);
+char *fz_lookup_base14_font_from_file(fz_context *ctx, const char *name);
+char *fz_lookup_cjk_font_from_file(fz_context *ctx, int registry, int serif, int wmode);
+void fz_install_external_font_funcs(fz_context *ctx);
+
 #endif
diff --git a/source/fitz/font.c b/source/fitz/font.c
index e197fa1b..03bfbb34 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -420,13 +420,19 @@ fz_font *fz_load_fallback_font(fz_context *ctx, int script, int language, int se
 
 fz_font *fz_load_fallback_symbol_font(fz_context *ctx)
 {
-	const unsigned char *data;
-	int size;
 	if (!ctx->font->symbol)
 	{
+#ifndef NOBUILTINFONT
+		const unsigned char *data;
+		int size;
 		data = fz_lookup_noto_symbol_font(ctx, &size);
 		if (data)
 			ctx->font->symbol = fz_new_font_from_memory(ctx, NULL, data, size, 0, 0);
+#else
+		char *filename = get_font_file("freefont/FreeSans.ttf");
+		ctx->font->symbol = fz_new_font_from_file(ctx, NULL, filename, 0, 1);
+		free(filename);
+#endif
 	}
 	return ctx->font->symbol;
 }
diff --git a/source/fitz/noto.c b/source/fitz/noto.c
index f6951ba2..b1fdd981 100644
--- a/source/fitz/noto.c
+++ b/source/fitz/noto.c
@@ -1,8 +1,12 @@
