
(defun c:mini_style_hz() (mai_last_com "mini_style_hz") (mai_style_guide "HZ"))
(defun c:mini_style_khz() (mai_last_com "mini_style_khz") (mai_style_guide "KHZ"))
(defun c:mini_style_any() (mai_last_com "mini_style_any") (mai_style_guide nil))

;开放给用户自定义自己字库
(defun mai_style_guide ( sty_name / blist shx1 shx2 xxx n)
	(setq
		shx1 (car (mai_str2lst (car maidefaultfonts) "."))  ;设置文件中的单线英文字库，缺省为SUPEROS
		shx2 (car (mai_str2lst (cadr maidefaultfonts) ".")) ;设置文件中的双线英文字库，缺省为TXT2
	
		;【●●字库设置●●】
		;【常用字库<单线小字库 , 双线小字库 , 单线大字库 ,双线 , ttf系统字库>】
		; default-fonts = txt1.SHX , TXT2.SHX , HZDX.SHX , HZHT.SHX , 宋体

		blist
			(list
				(list "IMINI\(WST\)" "宋体")
				(list "IMINI\(WHT\)" "黑体")
				(list "IMINI\(WFS\)" "仿宋体")
				(list "IMINI\(WKT\)" "楷体")
				(if (findfile "HZDX.shx") (list "IMINI(HZDX)" (strcat shx1 ",HZDX")))
				(if (findfile "HZxy.shx") (list "IMINI(HZXY)" (strcat shx2 ",HZXY")))
				(if (findfile "HZht.shx") (list "IMINI(HZHT)" (strcat shx2 ",HZHT")))
				(if (findfile "HZfs.shx") (list "IMINI(HZFS)" (strcat shx2 ",HZFS")))
				(if (findfile "HZhp.shx") (list "IMINI(HZHP)" (strcat shx2 ",HZHP")))
				(if (findfile "HZkt.shx") (list "IMINI(HZKT)" (strcat shx2 ",HZKT")))
				(if (findfile "HZls.shx") (list "IMINI(HZLS)" (strcat shx2 ",HZLS")))
				(if (findfile "HZwb.shx") (list "IMINI(HZWB)" (strcat shx2 ",HZWB")))
				(if (findfile "HZxk.shx") (list "IMINI(HZXK)" (strcat shx2 ",HZXK")))
				(if (findfile "HZzy.shx") (list "IMINI(HZZY)" (strcat shx2 ",HZZY")))
				(if (findfile "HZyy.shx") (list "IMINI(HZYY)" (strcat shx2 ",HZYY")))
				(if (findfile "HZlb.shx") (list "IMINI(HZLB)" (strcat shx2 ",HZLB")))
				(if (findfile "HZst.shx") (list "IMINI(HZST)" (strcat shx2 ",HZST")))
				(if (findfile "FTlb.shx") (list "IMINI(FTLB)" (strcat shx2 ",FTLB")))
				(if (findfile "FTwb.shx") (list "IMINI(FTWB)" (strcat shx2 ",FTWB")))
				(if (findfile "FTkt.shx") (list "IMINI(FTKT)" (strcat shx2 ",FTKT")))
				(if (findfile "FTxy.shx") (list "IMINI(FTXY)" (strcat shx2 ",FTXY")))
				(if (findfile "FTyy.shx") (list "IMINI(FTYY)" (strcat shx2 ",FTYY")))
				(if (findfile "FThp.shx") (list "IMINI(FTHP)" (strcat shx2 ",FTHP")))
				(if (findfile "FTzy.shx") (list "IMINI(FTZY)" (strcat shx2 ",FTZY")))
			)
		blist (vl-remove nil blist)
		xxx (mai_dcl_model1
				blist
				0
				"【修改字型】免费迷你iMini工具，版权属于MAI.C.Y<QQ:509157557>"
				(list
					5   ;图标行数
					5   ;图标列数
					15  ;图标宽度
					nil ;图标高度
					-2  ;图标底色
					T   ;显示图标下面文字
					T   ;显示图标下面放大图标
				)
				nil
				nil
				nil
			)
	)
	(if xxx
		(progn
			(setq
				n (car xxx)
				xxx (nth n blist)
			)
			(or sty_name
				(setq
					sty_name (vl-string-right-trim ")" (substr (car xxx) 7))
					sty_name (if (= sty_name "KHZ") "HZSUN" sty_name)
				)
			)
			(cond
				((= n 0)
					(or (mai_chk_ttf_file sty_name "宋体" 1)
						(mai_chk_ttf_file sty_name "新宋体" 1)
					)
				)
				((= n 1)
					(or (mai_chk_ttf_file sty_name "黑体" 1)
						(mai_chk_ttf_file sty_name "微软雅黑" 1)
					)
				)
				((= n 2)
					(or (mai_chk_ttf_file sty_name "仿宋" 1)
						(mai_chk_ttf_file sty_name "仿宋_GB2312" 1)
					)
				)
				((= n 3)
					(or (mai_chk_ttf_file sty_name "楷体" 1)
						(mai_chk_ttf_file sty_name "楷体_GB2312" 1)
					)
				)
				(T
					(command "-style" sty_name (cadr xxx))
					(mai_com_enter)
				)
			)
		)
	)
	sty_name
)


