+static HBITMAP
+create_offscreen_bitmap(HDC hdc, int width, int height, unsigned char **bitsp)
+{
+ struct {
+ BITMAPINFOHEADER h;
+ RGBQUAD c[2];
+ } info;
+
+ memset(&info, 0, sizeof(info));
+ info.h.biSize = sizeof(BITMAPINFOHEADER);
+ info.h.biWidth = width;
+ info.h.biHeight = -height;
+ info.h.biPlanes = 1;
+ info.h.biBitCount = 1;
+ info.h.biCompression = BI_RGB;
+ info.c[1].rgbRed = info.c[1].rgbGreen = info.c[1].rgbBlue = 255;
+
+ return CreateDIBSection(hdc, (LPBITMAPINFO)&info,
+ DIB_RGB_COLORS, bitsp, NULL, 0);
+}
+
+glyph_metric *
+w32_BDF_TextMetric(bdffont *fontp, unsigned char *text, int dim)
+{
+ int index;
+ cache_bitmap *pcb;
+
+ if (dim == 1)
+ index = *text;
+ else
+ index = MAKELENDSHORT(text[1], text[0]);
+
+ pcb = get_bitmap_with_cache(fontp, index);
+ if (!pcb)
+ return NULL;
+
+ return &(pcb->metric);
+}
+