diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js
index a1e3bd4..c63f158 100644
--- a/resources/js/ext.uls.webfonts.js
+++ b/resources/js/ext.uls.webfonts.js
@@ -119,6 +119,47 @@
 		return detected;
 	}
 
+	/**
+	 * Convert a Chinese Hanzi character to image data
+	 *
+	 * Draw the character on canvas, and return the bitmap in format: rgba rgba ...
+	 *
+	 * @param {string} character
+	 * @return {array}
+	 */
+	function convertHanziToImageData( character ) {
+		var canv = document.createElement("canvas");
+		canv.width = 80; // 4+72+4, put the 72px char at center, and leave 4px as padding
+		canv.height= 80;
+
+		var ctx=canv.getContext("2d");
+		ctx.font="72px 宋体";
+		ctx.fillText(character,4,68);
+
+		var imgData=ctx.getImageData( 0, 0, canv.width, canv.height ).data;
+		return imgData;
+	}
+
+	/**
+	 * Detect Chinese tofu
+	 *
+	 * Create tofu's and the character's images, compare them to see if the
+	 * character is rendered as a tofu
+	 *
+	 * @param {string} text
+	 * @return {boolean}
+	 */
+	function detectChineseTofu( character ) {
+		// TODO: TOFU_IMAGE_DATA can be created only once
+		var TOFU_IMAGE_DATA = convertHanziToImageData("鿿"); // a known tofu: &#x9fff;
+
+		var characterImageData = convertHanziToImageData( character );
+		for (var i=0; i<TOFU_IMAGE_DATA.length; i++)
+			if( characterImageData[i]!=TOFU_IMAGE_DATA[i] )
+				return false;
+		return true;
+	}
+	
 	mw.webfonts.setup = function () {
 		// Initialize webfonts
 		var mediawikiFontRepository = $.webfonts.repository;
