Lisp HUG Maillist Archive

Underline text in CAPI

Hello all,

Does anybody know easy way to create a text pane with underlined text in CAPI?

Rich text panes seem to support underlined text:

http://www.lispworks.com/documentation/lw51/CAPRM/html/capiref-350.htm#91837

But font description list does not seem to have it:

http://www.lispworks.com/documentation/lw51/CAPUG-M/html/capiuser-m-150.htm#pgfId-902252

Best regards,

Mikko Ahonen


Re: Underline text in CAPI

On Saturday 03 May 2008 8:36:39 am Mikko Ahonen wrote:
> Hello all,
>
> Does anybody know easy way to create a text pane with underlined text in
> CAPI?
>
> Rich text panes seem to support underlined text:
>
> http://www.lispworks.com/documentation/lw51/CAPRM/html/capiref-350.htm#9183
>7
>
> But font description list does not seem to have it:
>
> http://www.lispworks.com/documentation/lw51/CAPUG-M/html/capiuser-m-150.htm
>#pgfId-902252

As I understand it, underlining isn't part of the font, but it is a function 
of rich-text.  Here's an example:

(setq rtp 
      (capi:contain 
       (make-instance 
        'capi:rich-text-pane 
        :protected-callback 'ok-to-edit-p
        :character-format 
        '(:size 14  :color :red)
        :visible-min-height 300
        :visible-min-width 400
        :paragraph-format 
        '(:start-indent 20 :offset -15)
        :text-limit 160
        :text (format nil "First paragraph.~%Second paragraph, a little 
longer.~%Another paragraph, which should be long long enough that it spans 
more than one line. ~%" ))))

(defun ul ()
  (capi:set-rich-text-pane-character-format 
   rtp
   :attributes-plist '(:color :blue :underline t)  
   :selection nil))

pt


Updated at: 2020-12-10 08:43 UTC