private void verifyAndPrepareParam(Map<String, String> textMap,
			StyleConfig styleConfig) throws TextImageException {
		// 验证textMap
		if (textMap == null || textMap.size() == 0) {
			throw new TextImageException("textMap cant be empty!");
		}
		// 如果未传入样式，创建默认样式
		if (styleConfig == null) {
			throw new TextImageException("styleConfig cant be null ");
		} else {
			// 验证styleConfig
			for (TextStyle style : styleConfig.getClassMap().values()) {
				// 验证字体是否存在
				if (!PaintEnvironment.isSupportFont(style.getFontName())) {
					throw new TextImageException("not support font "
							+ style.getFontName());
				}
			}
		}
		// 清除值为Null的项和非字符串的项
		@SuppressWarnings("unchecked")
		Entry<String, String>[] entrys = textMap.entrySet().toArray(
				new Entry[textMap.size()]);
		for (Entry<String, String> entry : entrys) {
			if (StringUtils.isBlank(entry.getValue())) {
				textMap.remove(entry.getKey());
			}
		}
	}