fontsrv: use CoreText API on OS X
This gets us font fallback for free and avoids use of a deprecated API that might go away some day. Change-Id: I4b9b1a1ce3e6d98bfb407e3baea13f4adfe2c26a Reviewed-on: https://plan9port-review.googlesource.com/1160 Reviewed-by: Russ Cox <rsc@swtch.com>
This commit is contained in:
parent
5d86ecd4b7
commit
32dc15fa62
5 changed files with 142 additions and 105 deletions
|
|
@ -102,7 +102,7 @@ load(XFont *f)
|
|||
}
|
||||
|
||||
Memsubfont*
|
||||
mksubfont(char *name, int lo, int hi, int size, int antialias)
|
||||
mksubfont(XFont *xf, char *name, int lo, int hi, int size, int antialias)
|
||||
{
|
||||
XFont *xf, *xfp, *xfe;
|
||||
FT_Face face;
|
||||
|
|
@ -115,17 +115,6 @@ mksubfont(char *name, int lo, int hi, int size, int antialias)
|
|||
Memsubfont *sf;
|
||||
//Point rect_points[4];
|
||||
|
||||
xf = nil;
|
||||
for(xfp=xfont, xfe=xfont+nxfont; xfp != xfe; xfp++) {
|
||||
if(strcmp(xfp->name, name) == 0) {
|
||||
xf = xfp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!xf)
|
||||
return nil;
|
||||
|
||||
e = FT_New_Face(lib, xf->fontfile, xf->index, &face);
|
||||
|
||||
if(e){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue