/[cl-cairo2]/text.lisp
ViewVC logotype

Contents of /text.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Thu Jun 21 09:07:42 2007 UTC (6 years, 9 months ago) by tpapp
File size: 1304 byte(s)
added svg and xlib support
1 (in-package :cl-cairo2)
2
3 ;;;;
4 ;;;; Notes
5 ;;;;
6 ;;;; The text interface is still preliminary. I have postponed
7 ;;;; writing it until I have some knowledge of what people want to
8 ;;;; use it for, for me, what is below suffices.
9 ;;;;
10 ;;;; The long-term solution would be integration with Pango (go
11 ;;;; manage glyphs) and a CLOS-wrapped system for fonts.
12 ;;;;
13 ;;;; Need to write:
14 ;;;;
15 ;;;; set-font-matrix, get-font-matrix, set-font-options,
16 ;;;; get-font-options, set-font-face, get-font-face, set-scaled-font,
17 ;;;; get-scaled-font
18 ;;;;
19 ;;;; cairo_show_glyphs, cairo_font_extents, cairo_glyph_extents
20
21
22
23 (define-flexible (select-font-face pointer family slant weight)
24 (cairo_select_font_face pointer
25 family
26 (lookup-enum slant table-font-slant)
27 (lookup-enum weight table-font-weight)))
28
29 (define-with-default-context set-font-size size)
30
31 (define-flexible (text-extents pointer text)
32 (with-foreign-pointer (extents-pointer
33 (foreign-type-size 'cairo_text_extents_t))
34 (cairo_text_extents pointer text extents-pointer)
35 (with-foreign-slots ((x_bearing y_bearing width height
36 x_advance y_advance)
37 extents-pointer cairo_text_extents_t)
38 (values x_bearing y_bearing width height x_advance y_advance))))
39
40 (define-with-default-context-sync show-text text)

  ViewVC Help
Powered by ViewVC 1.1.5