fontsrv: handle non-BMP runes on X11

Have to adjust algorithms to deal with
much larger number of subfont files as well.
This commit is contained in:
Russ Cox
2020-05-26 11:36:59 -04:00
parent a6ad39aaaa
commit 5f0fa185d0
4 changed files with 45 additions and 44 deletions

View File

@@ -200,9 +200,12 @@ load(XFont *f)
f->loadheight = fontheight;
// enable all Unicode ranges
if(nelem(f->file) > 0xffff)
sysfatal("too many subfiles"); // f->file holds ushorts
for(i=0; i<nelem(f->range); i++) {
f->range[i] = 1;
f->nrange++;
f->file[i] = i;
f->nfile++;
}
}
@@ -233,7 +236,6 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias)
if(font == nil)
return nil;
bbox = CTFontGetBoundingBox(font);
x = (int)(bbox.size.width*2 + 0.99999999);