+ if (TextLength * FontCellWidth + PosX > CompImage->Width)
+ TextLength = (CompImage->Width - PosX) / FontCellWidth;
+
+ if (BGBrightness < 128) {
+ if (LightFontImage == NULL) {
+ LightFontImage = egCopyImage(BaseFontImage);
+ if (LightFontImage == NULL)
+ return;
+ for (i = 0; i < (LightFontImage->Width * LightFontImage->Height); i++) {
+ LightFontImage->PixelData[i].r = 255 - LightFontImage->PixelData[i].r;
+ LightFontImage->PixelData[i].g = 255 - LightFontImage->PixelData[i].g;
+ LightFontImage->PixelData[i].b = 255 - LightFontImage->PixelData[i].b;
+ } // for
+ } // if
+ FontImage = LightFontImage;
+ } else {
+ if (DarkFontImage == NULL)
+ DarkFontImage = egCopyImage(BaseFontImage);
+ if (DarkFontImage == NULL)
+ return;
+ FontImage = DarkFontImage;
+ } // if/else