MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / PrepareFont

Method PrepareFont

rEFIt_UEFI/libeg/text.cpp:173–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173VOID XTheme::PrepareFont()
174{
175
176 TextHeight = FontHeight + (int)(TEXT_YMARGIN * 2 * Scale);
177 if (TypeSVG) {
178 return;
179 }
180
181 // load the font
182 if (FontImage.isEmpty()) {
183 DBG("load font image type %d\n", Font);
184 LoadFontImage(TRUE, 16, 16); //anyway success
185 }
186
187 if (!FontImage.isEmpty()) {
188 if (Font == FONT_GRAY) {
189 //invert the font. embedded is dark
190 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *p = FontImage.GetPixelPtr(0,0);
191 for (INTN Height = 0; Height < FontImage.GetHeight(); Height++){
192 for (INTN Width = 0; Width < FontImage.GetWidth(); Width++, p++){
193 p->Blue ^= 0xFF;
194 p->Green ^= 0xFF;
195 p->Red ^= 0xFF;
196 //p->a = 0xFF; //huh! dont invert opacity
197 }
198 }
199 // FontImage.Draw(0, 300, 0.6f); //for debug purpose
200 }
201 DBG("Font %d prepared WxH=%lldx%lld CharWidth=%lld\n", Font, FontWidth, FontHeight, CharWidth);
202
203 } else {
204 DBG("Failed to load font\n");
205 }
206}
207
208//search pixel similar to first
209inline bool SamePix(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Ptr, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& FirstPixel)

Callers 1

InitThemeFunction · 0.80

Calls 4

GetPixelPtrMethod · 0.80
GetHeightMethod · 0.80
GetWidthMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected