Skip to content

Commit

Permalink
fix render function for drawing text not only on window
Browse files Browse the repository at this point in the history
  • Loading branch information
filonenko-mikhail committed Aug 30, 2012
1 parent 341795a commit b2a289c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions clx-truetype.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -497,20 497,23 @@ position before rendering), horizontal and vertical advances.
(defun get-drawable-picture (drawable)
(or (getf (xlib:drawable-plist drawable) :ttf-surface)
(setf (getf (xlib:drawable-plist drawable) :ttf-surface)
(xlib:render-create-picture drawable :format
(xlib:find-window-picture-format drawable)))))
(xlib:render-create-picture
drawable
:format (first (xlib::find-matching-picture-formats (xlib:drawable-display drawable)
:depth (xlib:drawable-depth drawable)))))))

(defun get-drawable-pen-picture (drawable)
(or (getf (xlib:drawable-plist drawable) :ttf-pen)
(setf (getf (xlib:drawable-plist drawable) :ttf-pen)
(xlib:render-create-picture
(xlib:render-create-picture
(or (getf (xlib:drawable-plist drawable) :ttf-pen-surface)
(setf (getf (xlib:drawable-plist drawable) :ttf-pen-surface)
(xlib:create-pixmap
:drawable drawable
:depth (xlib:drawable-depth drawable)
:width 1 :height 1)))
:format (xlib:find-window-picture-format drawable)
:format (first (xlib::find-matching-picture-formats (xlib:drawable-display drawable)
:depth (xlib:drawable-depth drawable)))
:repeat :on))))

(defun display-alpha-picture-format (display)
Expand Down Expand Up @@ -571,6 574,7 @@ If @var{gcontext} has background color, text line bounding box will be filled wi
(return-from draw-text-line))
(let* ((display (xlib:drawable-display drawable))
(image (xlib:create-image :width width :height height :depth 8 :data alpha-data))

(alpha-pixmap (xlib:create-pixmap :width width :height height :depth 8 :drawable drawable))
(alpha-gc (xlib:create-gcontext :drawable alpha-pixmap))
(alpha-picture
Expand Down

0 comments on commit b2a289c

Please sign in to comment.