Commit be094850 authored by Keith Packard's avatar Keith Packard

Add support for user-provided freetype faces to Xft

parent bff617fa
/*
* $XFree86: $
* $XFree86: xc/lib/fontconfig/fontconfig/fcfreetype.h,v 1.2 2002/02/15 06:01:27 keithp Exp $
*
* Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -32,4 +32,10 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4);
FcCharSet *
FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks);
FcResult
FcPatternGetFTFace (FcPattern *p, const char *object, int n, FT_Face *f);
FcBool
FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f);
#endif
/*
* $XFree86: $
* $XFree86: xc/lib/fontconfig/fontconfig/fcprivate.h,v 1.2 2002/02/15 06:01:27 keithp Exp $
*
* Copyright 2001 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -70,6 +70,8 @@
case FcTypeCharSet: \
__v__.u.c = va_arg (va, FcCharSet *); \
break; \
case FcTypeFTFace: \
__v__.u.f = va_arg (va, FT_Face); \
} \
if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \
goto _FcPatternVapBuild_bail1; \
......
/*
* $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.12 2002/05/29 08:21:33 keithp Exp $
* $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.13 2002/05/31 04:42:42 keithp Exp $
*
* Copyright 2001 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -59,6 +59,7 @@ typedef int FcBool;
#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
#define FC_FILE "file" /* String */
#define FC_INDEX "index" /* Int */
#define FC_FT_FACE "ftface" /* FT_Face */
#define FC_RASTERIZER "rasterizer" /* String */
#define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */
......@@ -145,7 +146,8 @@ typedef enum _FcType {
FcTypeString,
FcTypeBool,
FcTypeMatrix,
FcTypeCharSet
FcTypeCharSet,
FcTypeFTFace
} FcType;
typedef struct _FcMatrix {
......@@ -186,6 +188,7 @@ typedef struct _FcValue {
double d;
const FcMatrix *m;
const FcCharSet *c;
void *f;
} u;
} FcValue;
......
/*
* $XFree86: xc/lib/fontconfig/src/fccharset.c,v 1.9 2002/05/29 22:07:33 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fccharset.c,v 1.10 2002/05/31 04:42:42 keithp Exp $
*
* Copyright 2001 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -1099,9 +1099,6 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c)
return FcTrue;
}
#include <freetype/freetype.h>
#include <fontconfig/fcfreetype.h>
/*
* Figure out whether the available freetype has FT_Get_Next_Char
*/
......
......@@ -29,7 +29,6 @@
#include <freetype/freetype.h>
#include <freetype/internal/ftobjs.h>
#include <freetype/tttables.h>
#include <fontconfig/fcfreetype.h>
static const struct {
int bit;
......
/*
* $XFree86: xc/lib/fontconfig/src/fcint.h,v 1.10 2002/05/29 22:07:33 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcint.h,v 1.11 2002/05/31 04:42:42 keithp Exp $
*
* Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -36,6 +36,7 @@
#include <time.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcprivate.h>
#include <fontconfig/fcfreetype.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
......
/*
* $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.4 2002/05/22 04:12:35 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.5 2002/05/29 22:07:33 keithp Exp $
*
* Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
*
......@@ -142,6 +142,8 @@ FcValueEqual (FcValue va, FcValue vb)
return FcMatrixEqual (va.u.m, vb.u.m);
case FcTypeCharSet:
return FcCharSetEqual (va.u.c, vb.u.c);
case FcTypeFTFace:
return va.u.f == vb.u.f;
}
return FcFalse;
}
......@@ -416,6 +418,16 @@ FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c)
return FcPatternAdd (p, object, v, FcTrue);
}
FcBool
FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f)
{
FcValue v;
v.type = FcTypeFTFace;
v.u.f = (void *) f;
return FcPatternAdd (p, object, v, FcTrue);
}
FcResult
FcPatternGet (FcPattern *p, const char *object, int id, FcValue *v)
{
......@@ -542,6 +554,21 @@ FcPatternGetCharSet (FcPattern *p, const char *object, int id, FcCharSet **c)
return FcResultMatch;
}
FcResult
FcPatternGetFTFace (FcPattern *p, const char *object, int id, FT_Face *f)
{
FcValue v;
FcResult r;
r = FcPatternGet (p, object, id, &v);
if (r != FcResultMatch)
return r;
if (v.type != FcTypeFTFace)
return FcResultTypeMismatch;
*f = (FT_Face) v.u.f;
return FcResultMatch;
}
FcPattern *
FcPatternDuplicate (FcPattern *orig)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment