- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 10
 - 11
 - 12
 - 13
 - 14
 - 15
 - 16
 - 17
 - 18
 - 19
 - 20
 
                        do {
			size = ($("#textHeight").val()) + "px";
			$("#textView")
				.text($("#textInput").val())
				.css({
					"color":rs.textColor,
					"font-color":"#" + rs.textColor,
					"font-size":size
				});
			Cufon.set("fontSize", size).replace("#textView", {
				"color":"#" + rs.textColor,
				"fontSize":size
			});
			$("#textView").center("#canvasBg");
			($("#textView canvas").length ? $("#textView canvas") : $("#textView")).center("#canvasBg");
			if ($("#textView canvas").length && ($("#textView canvas").width() <= $("#canvasBg").width()) && ($("#textView canvas").height() <= $("#canvasBg").height())) break;
			if (($("#textView").width() <= $("#canvasBg").width()) && ($("#textView").height() <= $("#canvasBg").height())) break;
			$("#textHeight").val($("#textHeight").val() - 1);
		} while ($("#textHeight").val() > 9);
                                 
        
            Было сжатие картинки в цикле, а вот вам подгонка текста в канвасе.
        
        
Комментарии (3) RSS
Добавить комментарий