-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxft.scm
970 lines (822 loc) · 29.7 KB
/
xft.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
;; Copyright 2011-2013 John J Foerch. All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are
;; met:
;;
;; 1. Redistributions of source code must retain the above copyright
;; notice, this list of conditions and the following disclaimer.
;;
;; 2. Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in
;; the documentation and/or other materials provided with the
;; distribution.
;;
;; THIS SOFTWARE IS PROVIDED BY JOHN J FOERCH ''AS IS'' AND ANY EXPRESS OR
;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL JOHN J FOERCH OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
;; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
;; ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(module xft
(
;; FontConfig
;; XftColor
make-xftcolor
xftcolor-red
xftcolor-green
xftcolor-blue
xftcolor-alpha
;; XftDraw
xftdraw-create
xftdraw-create-bitmap
xftdraw-create-alpha
xftdraw-change
xftdraw-display
xftdraw-drawable
xftdraw-colormap
xftdraw-visual
xftdraw-destroy
xftdraw-picture
xftdraw-set-clip!
xftdraw-set-clip-rectangles!
xftdraw-set-subwindow-mode!
;; XftFontInfo
xft-fontinfo-create
xft-fontinfo-destroy
xft-fontinfo-hash
xft-fontinfo-equal
;; XftFont
make-xftfont
free-xftfont
xftfont-ascent
xftfont-descent
xftfont-height
xftfont-max-advance-width
xftfont-charset
xftfont-pattern
xftfont-match
xft-font-open
xft-font-open/name
xft-font-open/xlfd
xft-font-open/info
xft-font-open/pattern
xft-lock-face
xft-unlock-face
xft-font-copy
xft-font-close
xft-font-load-glyphs
xft-font-unload-glyphs
xft-font-check-glyph
xft-char-exists
xft-char-index
;; XftCharSpec
make-xftcharspec
free-xftcharspec
xftcharspec-ucs4
xftcharspec-x
xftcharspec-y
;; XftCharFontSpec
make-xftcharfontspec
free-xftcharfontspec
xftcharfontspec-font
xftcharfontspec-ucs4
xftcharfontspec-x
xftcharfontspec-y
;; XftGlyphSpec
make-xftglyphspec
free-xftglyphspec
xftglyphspec-glyph
xftglyphspec-x
xftglyphspec-y
;; XftGlyphFontSpec
make-xftglyphfontspec
free-xftglyphfontspec
xftglyphfontspec-font
xftglyphspec-glyph
xftglyphfontspec-x
xftglyphfontspec-y
;; Misc
xft-default-has-render
xft-default-set
xft-default-substitute
xft-name-parse
xft-xlfd-parse
xft-init
xft-get-version
xft-list-fonts
xft-init-ft-library
;; Draw on Drawables
xft-draw-src-picture
xft-draw-glyphs
xft-draw-string
xft-draw-char-spec
xft-draw-char-font-spec
xft-draw-glyph-spec
xft-draw-glyph-font-spec
xft-draw-rect
;; Extents
xft-text-extents
;; Rendering
xft-glyph-render
xft-glyph-spec-render
xft-char-spec-render
xft-glyph-font-spec-render
xft-char-font-spec-render
xft-text-render-8
xft-text-render-16
xft-text-render-16be
xft-text-render-16le
xft-text-render-32
xft-text-render-32be
xft-text-render-32le
xft-text-render-utf8
xft-text-render-utf16
)
;;; MISC
;;;
;; xft-get-version
;;; COLOR
;;;
;; make-xftcolor xftcolor-red xftcolor-green xftcolor-blue xftcolor-alpha
;;; DRAW ON X DRAWABLE OR X RENDERING EXTENSION DRAWABLE
;;;
;; xft-draw-rect
;; xft-draw-glyphs
;; xft-draw-string*
;; xft-draw-char-spec
;; xft-draw-glyph-spec
;;; CONSTRUCT/POPULATE XFTFONT
;;;
;;; XftFont structures are internally allocated and freed.
;;;
;; xft-font-open
;; xft-font-open/name (for loading Xft-style font names)
;; xft-font-open/xlfd (Xft equiv of Xlib's XLoadQueryFont)
;; xft-font-open/info (open font based on an XftFontInfo object)
;; xft-font-open/pattern
;;; MEASURE TEXT METRICS
;;;
;; xft-glyph-extents
;; xft-text-extents*
;;; CHECK FOR GLYPHS IN FONTS
;;;
;; xft-font-check-glyph
;; xft-char-exists
;; xft-char-index
;;; DRAW ON X RENDERING EXTENSIONS PICTURE STRUCTURES
;;;
;; xft-glyph-render
;; xft-glyph-spec-render
;; xft-char-spec-render
;; xft-text-render*
;;; XFTFONTINFO
;;;
;;; An opaque object that store information about a font. Internally
;;; allocated and freed.
;;;
;; xft-fontinfo-create
;; xft-fontinfo-destroy (normally not needed?)
;; xft-fontinfo-equal
;; xft-fontinfo-hash
;;; XFTDRAW
;;;
;;; Opaque object, wrapper around X drawable. Allocated and freed
;;; internally.
;;;
;; xftdraw-create (create xftdraw, given X drawable)
;; xftdraw-create-bitmap (create xftdraw, given pixmap)
;; xftdraw-create-alpha (create xftdraw, given pixmap)
;; xftdraw-destroy (not normally needed)
;; xftdraw-display
;; xftdraw-drawable
;; xftdraw-colormap
;; xftdraw-visual
;; xftdraw-picture
(import chicken scheme foreign)
(use foreigners
xtypes)
(foreign-declare "#include <X11/Xft/Xft.h>")
;;;
;;; Utils
;;;
(define (inexact->int n)
(inexact->exact (round n)))
;;;
;;; FontConfig
;;;
(define-foreign-type fcchar8 unsigned-char)
(define-foreign-type fcchar16 unsigned-short)
(define-foreign-type fcchar32 unsigned-int)
(define-foreign-type fcbool int)
(define-foreign-enum-type (fcendian int)
(fcendian->int int->fcendian)
((big) FcEndianBig)
((little) FcEndianLittle))
(define-foreign-type fccharset (c-pointer (struct _FcCharSet)))
(define-foreign-type fcpattern (c-pointer (struct _FcPattern)))
(define-foreign-enum-type (fcresult (enum _FcResult))
(fcresult->int int->fcresult)
((match) FcResultMatch)
((nomatch) FcResultNoMatch)
((typemismatch) FcResultTypeMismatch)
((noid) FcResultNoId)
((outofmemory) FcResultOutOfMemory))
(define-foreign-record-type (fcfontset FcFontSet)
(constructor: make-fcfontset)
(destructor: free-fcfontset)
(int nfont fcfontset-nfont)
(int sfont fcfontset-sfont)
((c-pointer fcpattern) fonts fcfontset-fonts))
(define fcfontset-print
(foreign-lambda void FcFontSetPrint
(const fcfontset)))
;;;
;;; FreeType
;;;
(define-foreign-type ft_face c-pointer)
(define-foreign-type ft_uint unsigned-int)
;;;
;;; Xlib
;;;
(define-foreign-type drawable unsigned-long)
(define-foreign-type xdisplay (c-pointer (struct _XDisplay)))
(define-foreign-type visual c-pointer)
(define-foreign-type colormap unsigned-long)
(define-foreign-type pixmap unsigned-long)
(define-foreign-type picture unsigned-long)
(define-foreign-type xrectangle c-pointer)
(define-foreign-type xregion (c-pointer (struct _XRegion)))
(define-foreign-type xglyphinfo c-pointer)
(define-foreign-type xrendercolor c-pointer)
;;;
;;; XftColor
;;;
(define-foreign-record-type (xftcolor XftColor)
(constructor: %make-xftcolor)
(destructor: %free-xftcolor)
(unsigned-long pixel xftcolor-pixel)
((struct XRenderColor) color xftcolor-color))
(define %xftcolor-alloc/name
(foreign-lambda bool XftColorAllocName
xdisplay ;; dpy
(const visual) ;; visual
colormap ;; cmap
(const c-string) ;; name
xftcolor)) ;; result
(define %xftcolor-alloc/value
(foreign-lambda bool XftColorAllocValue
xdisplay ;; dpy
visual ;; visual
colormap ;; cmap
(const xrendercolor) ;; color
xftcolor)) ;; result
(define %xftcolor-free
(foreign-lambda void XftColorFree
xdisplay ;; dpy
visual ;; visual
colormap ;; cmap
xftcolor)) ;; color
(define make-xftcolor
(case-lambda
((display visual colormap name)
(let ((xftc (%make-xftcolor)))
(%xftcolor-alloc/name display
visual
colormap
name
xftc)
(set-finalizer! xftc
(lambda (x)
(%xftcolor-free display visual colormap x)
(%free-xftcolor x)))
xftc))
((display visual colormap r g b a)
(let ((xftc (%make-xftcolor))
(c (make-xrendercolor r g b a)))
(%xftcolor-alloc/value display
visual
colormap
c
xftc)
(set-finalizer! xftc
(lambda (x)
(%xftcolor-free display visual colormap x)
(%free-xftcolor x)))
xftc))
((display visual colormap r g b)
(make-xftcolor display visual colormap r g b 1.0))))
(define (xftcolor-red x)
(xrendercolor-red (xftcolor-color x)))
(define (xftcolor-green x)
(xrendercolor-green (xftcolor-color x)))
(define (xftcolor-blue x)
(xrendercolor-blue (xftcolor-color x)))
(define (xftcolor-alpha x)
(xrendercolor-alpha (xftcolor-color x)))
;;;
;;; XftDraw
;;;
(define-foreign-type xftdraw (c-pointer (struct _XftDraw)))
(define xftdraw-create
(foreign-lambda xftdraw XftDrawCreate
xdisplay ;; dpy
drawable ;; drawable
visual ;; visual
colormap)) ;; colormap
(define xftdraw-create-bitmap
(foreign-lambda xftdraw XftDrawCreateBitmap
xdisplay ;; dpy
pixmap)) ;; bitmap
(define xftdraw-create-alpha
(foreign-lambda xftdraw XftDrawCreateAlpha
xdisplay ;; dpy
pixmap ;; pixmap
int)) ;; depth
(define xftdraw-change
(foreign-lambda void XftDrawChange
xftdraw
drawable))
(define xftdraw-display
(foreign-lambda xdisplay XftDrawDisplay
xftdraw))
(define xftdraw-drawable
(foreign-lambda drawable XftDrawDrawable
xftdraw))
(define xftdraw-colormap
(foreign-lambda colormap XftDrawColormap
xftdraw)) ;; draw
(define xftdraw-visual
(foreign-lambda visual XftDrawVisual
xftdraw)) ;; draw
(define xftdraw-destroy
(foreign-lambda void XftDrawDestroy
xftdraw))
;; returns 0 if the X server does not support X Rendering Extension
(define xftdraw-picture
(foreign-lambda picture XftDrawPicture
xftdraw))
(define xftdraw-set-clip!
(foreign-lambda bool XftDrawSetClip
xftdraw ;; draw
xregion)) ;; r
(define xftdraw-set-clip-rectangles!
(foreign-lambda bool XftDrawSetClipRectangles
xftdraw ;; draw
int ;; xOrigin
int ;; yOrigin
(const xrectangle) ;; *rects
int)) ;; n
(define xftdraw-set-subwindow-mode!
(foreign-lambda void XftDrawSetSubwindowMode
xftdraw ;; draw
int)) ;; mode
;;;
;;; XftFontInfo
;;;
(define-foreign-type xftfontinfo (c-pointer (struct _XftFontInfo)))
(define xft-fontinfo-create
(foreign-lambda xftfontinfo XftFontInfoCreate
xdisplay ;; dpy
(const fcpattern))) ;; pattern
(define xft-fontinfo-destroy
(foreign-lambda void XftFontInfoDestroy
xdisplay ;; dpy
xftfontinfo)) ;; fi
(define xft-fontinfo-hash
(foreign-lambda fcchar32 XftFontInfoHash
(const xftfontinfo))) ;; fi
(define xft-fontinfo-equal
(foreign-lambda fcbool XftFontInfoEqual
(const xftfontinfo) ;; a
(const xftfontinfo))) ;; b
;;;
;;; XftFont
;;;
(define-foreign-record-type (xftfont XftFont)
(constructor: make-xftfont)
(destructor: free-xftfont)
(int ascent xftfont-ascent)
(int descent xftfont-descent)
(int height xftfont-height)
(int max_advance_width xftfont-max-advance-width)
(fccharset charset xftfont-charset)
(fcpattern pattern xftfont-pattern))
(define xftfont-match
(foreign-lambda fcpattern XftFontMatch
xdisplay ;; dpy
int ;; screen
(const fcpattern) ;; *pattern
(c-pointer fcresult))) ;; *result
;; this can return NULL
;; example FIELD is XFT_FAMILY
;; example TYPE is XftTypeString, XftTypeDouble
;; example VALUE is "charter" or 12.0
(define xft-font-open
(foreign-lambda xftfont XftFontOpen
xdisplay ;; dpy
int ;; screen
;; ... (list of pattern element triples FIELD, TYPE, VALUE, terminating with a NULL)
)) ;; _X_SENTINEL(0)
(define xft-font-open/name
(foreign-lambda xftfont XftFontOpenName
xdisplay ;; dpy
int ;; screen
(const c-string))) ;; name
(define xft-font-open/xlfd
(foreign-lambda xftfont XftFontOpenXlfd
xdisplay ;; dpy
int ;; screen
(const c-string))) ;; xlfd
(define xft-font-open/info
(foreign-lambda xftfont XftFontOpenInfo
xdisplay ;; dpy
fcpattern ;; pattern
xftfontinfo)) ;; fi
(define xft-font-open/pattern
(foreign-lambda xftfont XftFontOpenPattern
xdisplay ;; dpy
fcpattern)) ;; pattern
(define xft-lock-face
(foreign-lambda ft_face XftLockFace
xftfont)) ;; pub
(define xft-unlock-face
(foreign-lambda void XftUnlockFace
xftfont)) ;; pub
(define xft-font-copy
(foreign-lambda xftfont XftFontCopy
xdisplay ;; dpy
xftfont)) ;; pub
(define xft-font-close
(foreign-lambda void XftFontClose
xdisplay ;; dpy
xftfont)) ;; pub
(define xft-font-load-glyphs
(foreign-lambda void XftFontLoadGlyphs
xdisplay ;; dpy
xftfont ;; pub
fcbool ;; need_bitmaps
(const (c-pointer ft_uint)) ;; *glyphs
int)) ;; nglyph
(define xft-font-unload-glyphs
(foreign-lambda void XftFontUnloadGlyphs
xdisplay ;; dpy
xftfont ;; pub
(const (c-pointer ft_uint)) ;; *glyphs,
int)) ;; nglyph
(define XFT_NMISSING 256)
(define xft-font-check-glyph
(foreign-lambda fcbool XftFontCheckGlyph
xdisplay ;; dpy
xftfont ;; pub
fcbool ;; need_bitmaps
ft_uint ;; glyph
(c-pointer ft_uint) ;; *missing
(c-pointer int))) ;; *nmissing
(define xft-char-exists
(foreign-lambda fcbool XftCharExists
xdisplay ;; dpy
xftfont ;; pub
fcchar32)) ;; ucs4
(define xft-char-index
(foreign-lambda ft_uint XftCharIndex
xdisplay ;; dpy
xftfont ;; pub
fcchar32)) ;; ucs4
;;;
;;; XftCharSpec
;;;
(define-foreign-record-type (xftcharspec XftCharSpec)
(constructor: make-xftcharspec)
(destructor: free-xftcharspec)
(fcchar32 ucs4 xftcharspec-ucs4)
(short x xftcharspec-x)
(short y xftcharspec-y))
;;;
;;; XftCharFontSpec
;;;
(define-foreign-record-type (xftcharfontspec XftCharFontSpec)
(constructor: make-xftcharfontspec)
(destructor: free-xftcharfontspec)
(xftfont font xftcharfontspec-font)
(fcchar32 ucs4 xftcharfontspec-ucs4)
(short x xftcharfontspec-x)
(short y xftcharfontspec-y))
;;;
;;; XftGlyphSpec
;;;
(define-foreign-record-type (xftglyphspec XftGlyphSpec)
(constructor: make-xftglyphspec)
(destructor: free-xftglyphspec)
(ft_uint glyph xftglyphspec-glyph)
(short x xftglyphspec-x)
(short y xftglyphspec-y))
;;;
;;; XftGlyphFontSpec
;;;
(define-foreign-record-type (xftglyphfontspec XftGlyphFontSpec)
(constructor: make-xftglyphfontspec)
(destructor: free-xftglyphfontspec)
(xftfont font xftglyphfontspec-font)
(ft_uint glyph xftglyphspec-glyph)
(short x xftglyphfontspec-x)
(short y xftglyphfontspec-y))
;;;
;;; Misc
;;;
;; not sure xft-default-has-render does. perhaps it tells whether there
;; are X Rendering Extensions available for the given display?
(define xft-default-has-render
(foreign-lambda bool XftDefaultHasRender
xdisplay)) ;; dpy
(define xft-default-set
(foreign-lambda bool XftDefaultSet
xdisplay ;; dpy
fcpattern)) ;; defaults
(define xft-default-substitute
(foreign-lambda void XftDefaultSubstitute
xdisplay ;; dpy
int ;; screen
fcpattern)) ;; pattern
(define xft-name-parse
(foreign-lambda fcpattern XftNameParse
(const c-string))) ;; name
(define xft-xlfd-parse
(foreign-lambda fcpattern XftXlfdParse
(const c-string) ;; xlfd_orig
bool ;; ignore_scalable
bool)) ;; complete
;; not sure what xft-init does. should it even be exported?
(define xft-init
(foreign-lambda bool XftInit
(const c-string))) ;; config
(define xft-get-version
(foreign-lambda int XftGetVersion))
(define xft-list-fonts
(foreign-lambda fcfontset XftListFonts
xdisplay ;; dpy
int ;; screen
;; ... (variable number of args)
c-pointer ;; null
c-pointer ;; null
)) ;; _X_SENTINEL(0)
(define xft-init-ft-library
(foreign-lambda fcbool XftInitFtLibrary))
;;;
;;; Draw on Drawables
;;;
;; not sure what xft-draw-src-picture does, or whether it should be
;; renamed to xftdraw-src-picture
(define xft-draw-src-picture
(foreign-lambda picture XftDrawSrcPicture
xftdraw ;; draw
(const xftcolor))) ;; color
(define xft-draw-glyphs
(foreign-lambda void XftDrawGlyphs
xftdraw ;; draw
(const xftcolor) ;; color
xftfont ;; XftFont* pub
int ;; x
int ;; y
(const (c-pointer ft_uint)) ;; glyphs
int)) ;; nglyphs
(define (xft-draw-string draw font color x y string)
((foreign-lambda void XftDrawStringUtf8
xftdraw
(const xftcolor)
xftfont
int
int
(const c-string)
int)
draw color font (inexact->int x) (inexact->int y)
string (string-length string)))
(define xft-draw-char-spec
(foreign-lambda void XftDrawCharSpec
xftdraw ;; draw
(const xftcolor) ;; color
xftfont ;; pub
(const xftcharspec) ;; chars
int)) ;; len
(define xft-draw-char-font-spec
(foreign-lambda void XftDrawCharFontSpec
xftdraw ;; draw
(const xftcolor) ;; color
(const xftcharfontspec) ;; chars
int)) ;; len
(define xft-draw-glyph-spec
(foreign-lambda void XftDrawGlyphSpec
xftdraw ;; draw
(const xftcolor) ;; color
xftfont ;; pub
(const xftglyphspec) ;; glyphs
int)) ;; len
(define xft-draw-glyph-font-spec
(foreign-lambda void XftDrawGlyphFontSpec
xftdraw ;; draw
(const xftcolor) ;; color
(const xftglyphfontspec) ;; glyphs
int)) ;; len
(define xft-draw-rect
(foreign-lambda void XftDrawRect
xftdraw ;; draw
(const xftcolor) ;; color
int ;; x
int ;; y
unsigned-int ;; width
unsigned-int)) ;; height
;;;
;;; Extents
;;;
(define (xft-text-extents display font string)
(let ((glyphinfo (make-xglyphinfo)))
((foreign-lambda void XftTextExtentsUtf8
xdisplay
xftfont
(const c-string)
int
xglyphinfo)
display font string (string-length string) glyphinfo)
glyphinfo))
;;;
;;; Rendering
;;;
(define xft-glyph-render
(foreign-lambda void XftGlyphRender
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer ft_uint)) ;; *glyphs
int)) ;; nglyphs
(define xft-glyph-spec-render
(foreign-lambda void XftGlyphSpecRender
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; *pub
picture ;; dst
int ;; srcx
int ;; srcy
(const xftglyphspec) ;; *glyphs
int)) ;; nglyphs
(define xft-char-spec-render
(foreign-lambda void XftCharSpecRender
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; *pub
picture ;; dst
int ;; srcx
int ;; srcy
(const xftcharspec) ;; *chars
int)) ;; len
(define xft-glyph-font-spec-render
(foreign-lambda void XftGlyphFontSpecRender
xdisplay ;; dpy
int ;; op
picture ;; src
picture ;; dst
int ;; srcx
int ;; srcy
(const xftglyphfontspec) ;; *glyphs
int)) ;; len
(define xft-char-font-spec-render
(foreign-lambda void XftCharFontSpecRender
xdisplay ;; dpy
int ;; op
picture ;; src
picture ;; dst
int ;; srcx
int ;; srcy
(const xftcharfontspec) ;; *chars
int)) ;; len
(define xft-text-render-8
(foreign-lambda void XftTextRender8
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-16
(foreign-lambda void XftTextRender16
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar16)) ;; string
int)) ;; len
(define xft-text-render-16be
(foreign-lambda void XftTextRender16BE
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-16le
(foreign-lambda void XftTextRender16LE
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-32
(foreign-lambda void XftTextRender32
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar32)) ;; string
int)) ;; len
(define xft-text-render-32be
(foreign-lambda void XftTextRender32BE
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-32le
(foreign-lambda void XftTextRender32LE
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-utf8
(foreign-lambda void XftTextRenderUtf8
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
int)) ;; len
(define xft-text-render-utf16
(foreign-lambda void XftTextRenderUtf16
xdisplay ;; dpy
int ;; op
picture ;; src
xftfont ;; pub
picture ;; dst
int ;; srcx
int ;; srcy
int ;; x
int ;; y
(const (c-pointer fcchar8)) ;; string
fcendian ;; endian
int)) ;; len
)