/[emacs]/emacs/src/w32bdf.c
ViewVC logotype

Diff of /emacs/src/w32bdf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by jasonr, Sun Feb 17 23:41:26 2002 UTC revision 1.16.4.1 by miles, Fri Apr 4 06:21:03 2003 UTC
# Line 54  cache_bitmap *pcached_bitmap_latest = ca Line 54  cache_bitmap *pcached_bitmap_latest = ca
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;
# Line 73  search_file_line(char *key, char *start, Line 73  search_file_line(char *key, char *start,
73        *val = start + strlen(key);        *val = start + strlen(key);
74        return 1;        return 1;
75      }      }
76      
77    return 0;    return 0;
78  }  }
79    
# Line 276  w32_init_bdf_font(char *filename) Line 276  w32_init_bdf_font(char *filename)
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;
# Line 285  w32_init_bdf_font(char *filename) Line 285  w32_init_bdf_font(char *filename)
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);
# Line 364  cache_char_offset(bdffont *fontp, int in Line 364  cache_char_offset(bdffont *fontp, int in
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;
# Line 578  get_bitmap_with_cache(bdffont *fontp, in Line 578  get_bitmap_with_cache(bdffont *fontp, in
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;
# Line 649  w32_BDF_TextOut(bdffont *fontp, HDC hdc, Line 649  w32_BDF_TextOut(bdffont *fontp, HDC hdc,
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    
# Line 679  w32_BDF_TextOut(bdffont *fontp, HDC hdc, Line 679  w32_BDF_TextOut(bdffont *fontp, HDC hdc,
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)

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.16.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26