我的一段程序中的一部分,fontw是字符长度
 - (setq ct 0)
- (setq j 1)
- ;判断包含英文字符个数
- (repeat FontW
- (if (< (ascii (substr txts j 1)) 127)
- (setq ct (1+ ct))
- )
- (setq j (1+ j))
- )
- (setq tmp (substr txts 1 (- FontW (rem ct 2)))) ;含奇数英文字符则少取一位
- (setq txts (substr txts (1+ (- FontW (rem ct 2))))) ;截取剩余字符
|