File indexing completed on 2025-01-18 10:14:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef _XFT_H_
0026 #define _XFT_H_
0027
0028
0029
0030
0031
0032 #define XFT_MAJOR 2
0033 #define XFT_MINOR 3
0034 #define XFT_REVISION 8
0035
0036 #define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION))
0037 #define XftVersion XFT_VERSION
0038
0039 #include <stdarg.h>
0040 #include <ft2build.h>
0041 #include FT_FREETYPE_H
0042 #include <fontconfig/fontconfig.h>
0043 #include <X11/extensions/Xrender.h>
0044
0045 #include <X11/Xfuncproto.h>
0046
0047 #ifndef _X_SENTINEL
0048 # define _X_SENTINEL(x)
0049 #endif
0050
0051 #ifndef _XFT_NO_COMPAT_
0052 #include <X11/Xft/XftCompat.h>
0053 #endif
0054
0055 #define XFT_CORE "core"
0056 #define XFT_RENDER "render"
0057 #define XFT_XLFD "xlfd"
0058 #define XFT_MAX_GLYPH_MEMORY "maxglyphmemory"
0059 #define XFT_MAX_UNREF_FONTS "maxunreffonts"
0060 #define XFT_TRACK_MEM_USAGE "trackmemusage"
0061
0062 extern FT_Library _XftFTlibrary;
0063
0064 typedef struct _XftFontInfo XftFontInfo;
0065
0066 typedef struct _XftFont {
0067 int ascent;
0068 int descent;
0069 int height;
0070 int max_advance_width;
0071 FcCharSet *charset;
0072 FcPattern *pattern;
0073 } XftFont;
0074
0075 typedef struct _XftDraw XftDraw;
0076
0077 typedef struct _XftColor {
0078 unsigned long pixel;
0079 XRenderColor color;
0080 } XftColor;
0081
0082 typedef struct _XftCharSpec {
0083 FcChar32 ucs4;
0084 short x;
0085 short y;
0086 } XftCharSpec;
0087
0088 typedef struct _XftCharFontSpec {
0089 XftFont *font;
0090 FcChar32 ucs4;
0091 short x;
0092 short y;
0093 } XftCharFontSpec;
0094
0095 typedef struct _XftGlyphSpec {
0096 FT_UInt glyph;
0097 short x;
0098 short y;
0099 } XftGlyphSpec;
0100
0101 typedef struct _XftGlyphFontSpec {
0102 XftFont *font;
0103 FT_UInt glyph;
0104 short x;
0105 short y;
0106 } XftGlyphFontSpec;
0107
0108 _XFUNCPROTOBEGIN
0109
0110
0111
0112 Bool
0113 XftColorAllocName (Display *dpy,
0114 _Xconst Visual *visual,
0115 Colormap cmap,
0116 _Xconst char *name,
0117 XftColor *result);
0118
0119 Bool
0120 XftColorAllocValue (Display *dpy,
0121 Visual *visual,
0122 Colormap cmap,
0123 _Xconst XRenderColor *color,
0124 XftColor *result);
0125
0126 void
0127 XftColorFree (Display *dpy,
0128 Visual *visual,
0129 Colormap cmap,
0130 XftColor *color);
0131
0132
0133 Bool
0134 XftDefaultHasRender (Display *dpy);
0135
0136 Bool
0137 XftDefaultSet (Display *dpy, FcPattern *defaults);
0138
0139 void
0140 XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern);
0141
0142
0143
0144 XftDraw *
0145 XftDrawCreate (Display *dpy,
0146 Drawable drawable,
0147 Visual *visual,
0148 Colormap colormap);
0149
0150 XftDraw *
0151 XftDrawCreateBitmap (Display *dpy,
0152 Pixmap bitmap);
0153
0154 XftDraw *
0155 XftDrawCreateAlpha (Display *dpy,
0156 Pixmap pixmap,
0157 int depth);
0158
0159 void
0160 XftDrawChange (XftDraw *draw,
0161 Drawable drawable);
0162
0163 Display *
0164 XftDrawDisplay (XftDraw *draw);
0165
0166 Drawable
0167 XftDrawDrawable (XftDraw *draw);
0168
0169 Colormap
0170 XftDrawColormap (XftDraw *draw);
0171
0172 Visual *
0173 XftDrawVisual (XftDraw *draw);
0174
0175 void
0176 XftDrawDestroy (XftDraw *draw);
0177
0178 Picture
0179 XftDrawPicture (XftDraw *draw);
0180
0181 Picture
0182 XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color);
0183
0184 void
0185 XftDrawGlyphs (XftDraw *draw,
0186 _Xconst XftColor *color,
0187 XftFont *pub,
0188 int x,
0189 int y,
0190 _Xconst FT_UInt *glyphs,
0191 int nglyphs);
0192
0193 void
0194 XftDrawString8 (XftDraw *draw,
0195 _Xconst XftColor *color,
0196 XftFont *pub,
0197 int x,
0198 int y,
0199 _Xconst FcChar8 *string,
0200 int len);
0201
0202 void
0203 XftDrawString16 (XftDraw *draw,
0204 _Xconst XftColor *color,
0205 XftFont *pub,
0206 int x,
0207 int y,
0208 _Xconst FcChar16 *string,
0209 int len);
0210
0211 void
0212 XftDrawString32 (XftDraw *draw,
0213 _Xconst XftColor *color,
0214 XftFont *pub,
0215 int x,
0216 int y,
0217 _Xconst FcChar32 *string,
0218 int len);
0219
0220 void
0221 XftDrawStringUtf8 (XftDraw *draw,
0222 _Xconst XftColor *color,
0223 XftFont *pub,
0224 int x,
0225 int y,
0226 _Xconst FcChar8 *string,
0227 int len);
0228
0229 void
0230 XftDrawStringUtf16 (XftDraw *draw,
0231 _Xconst XftColor *color,
0232 XftFont *pub,
0233 int x,
0234 int y,
0235 _Xconst FcChar8 *string,
0236 FcEndian endian,
0237 int len);
0238
0239 void
0240 XftDrawCharSpec (XftDraw *draw,
0241 _Xconst XftColor *color,
0242 XftFont *pub,
0243 _Xconst XftCharSpec *chars,
0244 int len);
0245
0246 void
0247 XftDrawCharFontSpec (XftDraw *draw,
0248 _Xconst XftColor *color,
0249 _Xconst XftCharFontSpec *chars,
0250 int len);
0251
0252 void
0253 XftDrawGlyphSpec (XftDraw *draw,
0254 _Xconst XftColor *color,
0255 XftFont *pub,
0256 _Xconst XftGlyphSpec *glyphs,
0257 int len);
0258
0259 void
0260 XftDrawGlyphFontSpec (XftDraw *draw,
0261 _Xconst XftColor *color,
0262 _Xconst XftGlyphFontSpec *glyphs,
0263 int len);
0264
0265 void
0266 XftDrawRect (XftDraw *draw,
0267 _Xconst XftColor *color,
0268 int x,
0269 int y,
0270 unsigned int width,
0271 unsigned int height);
0272
0273
0274 Bool
0275 XftDrawSetClip (XftDraw *draw,
0276 Region r);
0277
0278
0279 Bool
0280 XftDrawSetClipRectangles (XftDraw *draw,
0281 int xOrigin,
0282 int yOrigin,
0283 _Xconst XRectangle *rects,
0284 int n);
0285
0286 void
0287 XftDrawSetSubwindowMode (XftDraw *draw,
0288 int mode);
0289
0290
0291
0292 void
0293 XftGlyphExtents (Display *dpy,
0294 XftFont *pub,
0295 _Xconst FT_UInt *glyphs,
0296 int nglyphs,
0297 XGlyphInfo *extents);
0298
0299 void
0300 XftTextExtents8 (Display *dpy,
0301 XftFont *pub,
0302 _Xconst FcChar8 *string,
0303 int len,
0304 XGlyphInfo *extents);
0305
0306 void
0307 XftTextExtents16 (Display *dpy,
0308 XftFont *pub,
0309 _Xconst FcChar16 *string,
0310 int len,
0311 XGlyphInfo *extents);
0312
0313 void
0314 XftTextExtents32 (Display *dpy,
0315 XftFont *pub,
0316 _Xconst FcChar32 *string,
0317 int len,
0318 XGlyphInfo *extents);
0319
0320 void
0321 XftTextExtentsUtf8 (Display *dpy,
0322 XftFont *pub,
0323 _Xconst FcChar8 *string,
0324 int len,
0325 XGlyphInfo *extents);
0326
0327 void
0328 XftTextExtentsUtf16 (Display *dpy,
0329 XftFont *pub,
0330 _Xconst FcChar8 *string,
0331 FcEndian endian,
0332 int len,
0333 XGlyphInfo *extents);
0334
0335
0336 FcPattern *
0337 XftFontMatch (Display *dpy,
0338 int screen,
0339 _Xconst FcPattern *pattern,
0340 FcResult *result);
0341
0342 XftFont *
0343 XftFontOpen (Display *dpy, int screen, ...) _X_SENTINEL(0);
0344
0345 XftFont *
0346 XftFontOpenName (Display *dpy, int screen, _Xconst char *name);
0347
0348 XftFont *
0349 XftFontOpenXlfd (Display *dpy, int screen, _Xconst char *xlfd);
0350
0351
0352
0353 FT_Face
0354 XftLockFace (XftFont *pub);
0355
0356 void
0357 XftUnlockFace (XftFont *pub);
0358
0359 XftFontInfo *
0360 XftFontInfoCreate (Display *dpy, _Xconst FcPattern *pattern);
0361
0362 void
0363 XftFontInfoDestroy (Display *dpy, XftFontInfo *fi);
0364
0365 FcChar32
0366 XftFontInfoHash (_Xconst XftFontInfo *fi);
0367
0368 FcBool
0369 XftFontInfoEqual (_Xconst XftFontInfo *a, _Xconst XftFontInfo *b);
0370
0371 XftFont *
0372 XftFontOpenInfo (Display *dpy,
0373 FcPattern *pattern,
0374 XftFontInfo *fi);
0375
0376 XftFont *
0377 XftFontOpenPattern (Display *dpy, FcPattern *pattern);
0378
0379 XftFont *
0380 XftFontCopy (Display *dpy, XftFont *pub);
0381
0382 void
0383 XftFontClose (Display *dpy, XftFont *pub);
0384
0385 FcBool
0386 XftInitFtLibrary(void);
0387
0388
0389 void
0390 XftFontLoadGlyphs (Display *dpy,
0391 XftFont *pub,
0392 FcBool need_bitmaps,
0393 _Xconst FT_UInt *glyphs,
0394 int nglyph);
0395
0396 void
0397 XftFontUnloadGlyphs (Display *dpy,
0398 XftFont *pub,
0399 _Xconst FT_UInt *glyphs,
0400 int nglyph);
0401
0402 #define XFT_NMISSING 256
0403
0404 FcBool
0405 XftFontCheckGlyph (Display *dpy,
0406 XftFont *pub,
0407 FcBool need_bitmaps,
0408 FT_UInt glyph,
0409 FT_UInt *missing,
0410 int *nmissing);
0411
0412 FcBool
0413 XftCharExists (Display *dpy,
0414 XftFont *pub,
0415 FcChar32 ucs4);
0416
0417 FT_UInt
0418 XftCharIndex (Display *dpy,
0419 XftFont *pub,
0420 FcChar32 ucs4);
0421
0422
0423 FcBool
0424 XftInit (_Xconst char *config);
0425
0426 int
0427 XftGetVersion (void);
0428
0429
0430
0431 FcFontSet *
0432 XftListFonts (Display *dpy,
0433 int screen,
0434 ...) _X_SENTINEL(0);
0435
0436
0437 FcPattern
0438 *XftNameParse (_Xconst char *name);
0439
0440 FcBool
0441 XftNameUnparse (FcPattern *pat, char *dest, int len);
0442
0443
0444 void
0445 XftGlyphRender (Display *dpy,
0446 int op,
0447 Picture src,
0448 XftFont *pub,
0449 Picture dst,
0450 int srcx,
0451 int srcy,
0452 int x,
0453 int y,
0454 _Xconst FT_UInt *glyphs,
0455 int nglyphs);
0456
0457 void
0458 XftGlyphSpecRender (Display *dpy,
0459 int op,
0460 Picture src,
0461 XftFont *pub,
0462 Picture dst,
0463 int srcx,
0464 int srcy,
0465 _Xconst XftGlyphSpec *glyphs,
0466 int nglyphs);
0467
0468 void
0469 XftCharSpecRender (Display *dpy,
0470 int op,
0471 Picture src,
0472 XftFont *pub,
0473 Picture dst,
0474 int srcx,
0475 int srcy,
0476 _Xconst XftCharSpec *chars,
0477 int len);
0478
0479 void
0480 XftGlyphFontSpecRender (Display *dpy,
0481 int op,
0482 Picture src,
0483 Picture dst,
0484 int srcx,
0485 int srcy,
0486 _Xconst XftGlyphFontSpec *glyphs,
0487 int nglyphs);
0488
0489 void
0490 XftCharFontSpecRender (Display *dpy,
0491 int op,
0492 Picture src,
0493 Picture dst,
0494 int srcx,
0495 int srcy,
0496 _Xconst XftCharFontSpec *chars,
0497 int len);
0498
0499 void
0500 XftTextRender8 (Display *dpy,
0501 int op,
0502 Picture src,
0503 XftFont *pub,
0504 Picture dst,
0505 int srcx,
0506 int srcy,
0507 int x,
0508 int y,
0509 _Xconst FcChar8 *string,
0510 int len);
0511
0512 void
0513 XftTextRender16 (Display *dpy,
0514 int op,
0515 Picture src,
0516 XftFont *pub,
0517 Picture dst,
0518 int srcx,
0519 int srcy,
0520 int x,
0521 int y,
0522 _Xconst FcChar16 *string,
0523 int len);
0524
0525 void
0526 XftTextRender16BE (Display *dpy,
0527 int op,
0528 Picture src,
0529 XftFont *pub,
0530 Picture dst,
0531 int srcx,
0532 int srcy,
0533 int x,
0534 int y,
0535 _Xconst FcChar8 *string,
0536 int len);
0537
0538 void
0539 XftTextRender16LE (Display *dpy,
0540 int op,
0541 Picture src,
0542 XftFont *pub,
0543 Picture dst,
0544 int srcx,
0545 int srcy,
0546 int x,
0547 int y,
0548 _Xconst FcChar8 *string,
0549 int len);
0550
0551 void
0552 XftTextRender32 (Display *dpy,
0553 int op,
0554 Picture src,
0555 XftFont *pub,
0556 Picture dst,
0557 int srcx,
0558 int srcy,
0559 int x,
0560 int y,
0561 _Xconst FcChar32 *string,
0562 int len);
0563
0564 void
0565 XftTextRender32BE (Display *dpy,
0566 int op,
0567 Picture src,
0568 XftFont *pub,
0569 Picture dst,
0570 int srcx,
0571 int srcy,
0572 int x,
0573 int y,
0574 _Xconst FcChar8 *string,
0575 int len);
0576
0577 void
0578 XftTextRender32LE (Display *dpy,
0579 int op,
0580 Picture src,
0581 XftFont *pub,
0582 Picture dst,
0583 int srcx,
0584 int srcy,
0585 int x,
0586 int y,
0587 _Xconst FcChar8 *string,
0588 int len);
0589
0590 void
0591 XftTextRenderUtf8 (Display *dpy,
0592 int op,
0593 Picture src,
0594 XftFont *pub,
0595 Picture dst,
0596 int srcx,
0597 int srcy,
0598 int x,
0599 int y,
0600 _Xconst FcChar8 *string,
0601 int len);
0602
0603 void
0604 XftTextRenderUtf16 (Display *dpy,
0605 int op,
0606 Picture src,
0607 XftFont *pub,
0608 Picture dst,
0609 int srcx,
0610 int srcy,
0611 int x,
0612 int y,
0613 _Xconst FcChar8 *string,
0614 FcEndian endian,
0615 int len);
0616
0617
0618 FcPattern *
0619 XftXlfdParse (_Xconst char *xlfd_orig, Bool ignore_scalable, Bool complete);
0620
0621 _XFUNCPROTOEND
0622
0623 #endif