自贡黄明儒 发表于 2013-12-12 09:55:22

firstinti 发表于 2013-12-11 19:35 static/image/common/back.gif
因为在text没生成之前是不会知道字段的真实长度的,如果根据文字内容能算出来文字长度就根本就没有这个问 ...

没有生成之前,如果知道字体,好象可以知道真实长度
这是别人写的
;;str -- string
;;h   -- height
(defun XD::String:Len (sty str h scl)
(and (or (not sty)
    (= sty "")
    (not (tblsearch "style" sty))
       )
       (setq sty (getvar "textstyle"))
)
(abs
    (car
      (apply 'mapcar
      (cons '-
   (textbox (list (cons 1 str) (cons 7 sty) (cons 40 h) (cons 41 scl))
      )
      )
    )
)
)

llsheng_73 发表于 2013-12-12 21:38:49

好东东毫不客气的拿走,我也装回要做研究的样子
页: 1 [2]
查看完整版本: 如何绘制 "不足居中,太长压窄" 的文字。