1 //========================================================================
5 // Copyright 2001-2002 Glyph & Cog, LLC
7 //========================================================================
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
17 //------------------------------------------------------------------------
19 SFontEngine::SFontEngine(Display *displayA, Visual *visualA, int depthA,
27 SFontEngine::~SFontEngine() {
30 void SFontEngine::useTrueColor(int rMaxA, int rShiftA, int gMaxA, int gShiftA,
31 int bMaxA, int bShiftA) {
41 void SFontEngine::useColorCube(Gulong *colorsA, int nRGBA) {
45 rMax = gMax = bMax = nRGB - 1;
48 Gulong SFontEngine::findColor(int r, int g, int b) {
52 r1 = ((r & 0xffff) * rMax) / 0xffff;
53 g1 = ((g & 0xffff) * gMax) / 0xffff;
54 b1 = ((b & 0xffff) * bMax) / 0xffff;
56 pix = (r1 << rShift) + (g1 << gShift) + (b1 << bShift);
58 pix = colors[(r1 * nRGB + g1) * nRGB + b1];
63 //------------------------------------------------------------------------
65 SFontFile::SFontFile() {
68 SFontFile::~SFontFile() {
71 //------------------------------------------------------------------------
79 GBool SFont::getCharPath(CharCode c, Unicode u, GfxState *state) {