Skip to content

Commit

Permalink
use OpenBitmap when available
Browse files Browse the repository at this point in the history
Don't just use OpenScalable unconditionally.  Fixes builtin fonts.
  • Loading branch information
fooishbar authored and Daniel Stone committed Jul 19, 2006
1 parent 13422d0 commit fead0fa
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/fontfile/fontfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ FontFileOpenFont (pointer client, FontPathElementPtr fpe, Mask flags,
tmpName.ndashes = entry->name.ndashes;
}
}

if (entry)
{
noSpecificSize = FALSE; /* TRUE breaks XLFD enhancements */
Expand Down Expand Up @@ -436,9 +437,16 @@ FontFileOpenFont (pointer client, FontPathElementPtr fpe, Mask flags,
} else {
strcpy (fileName, dir->directory);
strcat (fileName, scalable->fileName);
ret = (*scalable->renderer->OpenScalable) (fpe, pFont,
flags, entry, fileName, &vals, format, fmask,
non_cachable_font);
if (scalable->renderer->OpenScalable) {
ret = (*scalable->renderer->OpenScalable) (fpe, pFont,
flags, entry, fileName, &vals, format, fmask,
non_cachable_font);
}
else if (scalable->renderer->OpenBitmap) {
ret = (*scalable->renderer->OpenBitmap) (fpe, pFont,
flags, entry, fileName, format, fmask,
non_cachable_font);
}
}

/* In case rasterizer does something bad because of
Expand Down Expand Up @@ -1007,8 +1015,13 @@ FontFileListOneFontWithInfo (pointer client, FontPathElementPtr fpe,
} else {
strcpy (fileName, dir->directory);
strcat (fileName, scalable->fileName);
ret = (*scalable->renderer->GetInfoScalable)
(fpe, *pFontInfo, entry, &tmpName, fileName, &vals);
if (scalable->renderer->GetInfoScalable)
ret = (*scalable->renderer->GetInfoScalable)
(fpe, *pFontInfo, entry, &tmpName, fileName,
&vals);
else if (scalable->renderer->GetInfoBitmap)
ret = (*scalable->renderer->GetInfoBitmap)
(fpe, *pFontInfo, entry, fileName);
}
if (ranges) {
xfree(ranges);
Expand Down

0 comments on commit fead0fa

Please # to comment.