54 |
|
|
55 |
#define FONT_CACHE_SLOT_OVER_P(p) ((p) >= cached_bitmap_slots + BDF_FONT_CACHE_SIZE) |
#define FONT_CACHE_SLOT_OVER_P(p) ((p) >= cached_bitmap_slots + BDF_FONT_CACHE_SIZE) |
56 |
|
|
57 |
static int |
static int |
58 |
search_file_line(char *key, char *start, int len, char **val, char **next) |
search_file_line(char *key, char *start, int len, char **val, char **next) |
59 |
{ |
{ |
60 |
unsigned int linelen; |
unsigned int linelen; |
73 |
*val = start + strlen(key); |
*val = start + strlen(key); |
74 |
return 1; |
return 1; |
75 |
} |
} |
76 |
|
|
77 |
return 0; |
return 0; |
78 |
} |
} |
79 |
|
|
276 |
} |
} |
277 |
|
|
278 |
bdffontp = (bdffont *) xmalloc(sizeof(bdffont)); |
bdffontp = (bdffont *) xmalloc(sizeof(bdffont)); |
279 |
|
|
280 |
for(i = 0;i < BDF_FIRST_OFFSET_TABLE;i++) |
for(i = 0;i < BDF_FIRST_OFFSET_TABLE;i++) |
281 |
bdffontp->chtbl[i] = NULL; |
bdffontp->chtbl[i] = NULL; |
282 |
bdffontp->size = fileinfo.nFileSizeLow; |
bdffontp->size = fileinfo.nFileSizeLow; |
285 |
bdffontp->hfilemap = hfilemap; |
bdffontp->hfilemap = hfilemap; |
286 |
bdffontp->filename = (char*) xmalloc(strlen(filename) + 1); |
bdffontp->filename = (char*) xmalloc(strlen(filename) + 1); |
287 |
strcpy(bdffontp->filename, filename); |
strcpy(bdffontp->filename, filename); |
288 |
|
|
289 |
if (!set_bdf_font_info(bdffontp)) |
if (!set_bdf_font_info(bdffontp)) |
290 |
{ |
{ |
291 |
w32_free_bdf_font(bdffontp); |
w32_free_bdf_font(bdffontp); |
364 |
{ |
{ |
365 |
pch = fontp->chtbl[BDF_FIRST_OFFSET(index)] = |
pch = fontp->chtbl[BDF_FIRST_OFFSET(index)] = |
366 |
(font_char*) HeapAlloc(hbdf_cp_heap, |
(font_char*) HeapAlloc(hbdf_cp_heap, |
367 |
HEAP_ZERO_MEMORY, |
HEAP_ZERO_MEMORY, |
368 |
sizeof(font_char) * |
sizeof(font_char) * |
369 |
BDF_SECOND_OFFSET_TABLE); |
BDF_SECOND_OFFSET_TABLE); |
370 |
if (!pch) return NULL; |
if (!pch) return NULL; |
578 |
pcb->row_byte_size = glyph.row_byte_size; |
pcb->row_byte_size = glyph.row_byte_size; |
579 |
|
|
580 |
pch->pcbmp = pcb; |
pch->pcbmp = pcb; |
581 |
|
|
582 |
pcached_bitmap_latest++; |
pcached_bitmap_latest++; |
583 |
if (FONT_CACHE_SLOT_OVER_P(pcached_bitmap_latest)) |
if (FONT_CACHE_SLOT_OVER_P(pcached_bitmap_latest)) |
584 |
pcached_bitmap_latest = cached_bitmap_slots; |
pcached_bitmap_latest = cached_bitmap_slots; |
649 |
return 0; |
return 0; |
650 |
|
|
651 |
textalign = GetTextAlign(hdc); |
textalign = GetTextAlign(hdc); |
652 |
|
|
653 |
hFgBrush = CreateSolidBrush(GetTextColor(hdc)); |
hFgBrush = CreateSolidBrush(GetTextColor(hdc)); |
654 |
hOrgBrush = SelectObject(hdc, hFgBrush); |
hOrgBrush = SelectObject(hdc, hFgBrush); |
655 |
|
|
679 |
{ |
{ |
680 |
width = pcb->metric.bbw; |
width = pcb->metric.bbw; |
681 |
height = pcb->metric.bbh; |
height = pcb->metric.bbh; |
682 |
|
|
683 |
if (!(hBMP |
if (!(hBMP |
684 |
&& (DIBsection_hdc == hdc) |
&& (DIBsection_hdc == hdc) |
685 |
&& (DIBsection_width == width) |
&& (DIBsection_width == width) |