/[qemacs]/qemacs/fbfrender.c
ViewVC logotype

Diff of /qemacs/fbfrender.c

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

revision 1.1.1.1 by bellard, Sat May 29 10:18:52 2004 UTC revision 1.2 by chqrlie, Wed May 11 15:48:31 2005 UTC
# Line 152  GlyphCache *fbf_decode_glyph1(QEFont *fo Line 152  GlyphCache *fbf_decode_glyph1(QEFont *fo
152                    
153          bitmap = fbf_glyph_entry->bitmap;          bitmap = fbf_glyph_entry->bitmap;
154          pitch = (src_width + 7) >> 3;          pitch = (src_width + 7) >> 3;
155          for(y=0;y<src_height;y++) {          for (y = 0; y < src_height; y++) {
156              for(x=0;x<src_width;x++) {              for (x = 0; x < src_width; x++) {
157                  bit = (bitmap[pitch * y + (x >> 3)] >>                  bit = (bitmap[pitch * y + (x >> 3)] >>
158                             (7 - (x & 7))) & 1;                             (7 - (x & 7))) & 1;
159                  glyph_cache->data[src_width * y + x] = -bit;                  glyph_cache->data[src_width * y + x] = -bit;
# Line 248  QEFont *fbf_open_font(QEditScreen *s, in Line 248  QEFont *fbf_open_font(QEditScreen *s, in
248                    
249          /* first match style */          /* first match style */
250          nb_fonts = 0;          nb_fonts = 0;
251          for(uf = first_font; uf != NULL; uf = uf->next_font) {          for (uf = first_font; uf != NULL; uf = uf->next_font) {
252              if (uf->family_type == style) {              if (uf->family_type == style) {
253                  fonts[nb_fonts++] = uf;                  fonts[nb_fonts++] = uf;
254              }              }
# Line 259  QEFont *fbf_open_font(QEditScreen *s, in Line 259  QEFont *fbf_open_font(QEditScreen *s, in
259              /* select closest size */              /* select closest size */
260              uf_found = NULL;              uf_found = NULL;
261              dmin = MAXINT;              dmin = MAXINT;
262              for(i = 0;i < nb_fonts;i++) {              for (i = 0;i < nb_fonts;i++) {
263                  uf = fonts[i];                  uf = fonts[i];
264                  d = abs(uf->pt_size - size);                  d = abs(uf->pt_size - size);
265                  if (d < dmin) {                  if (d < dmin) {
# Line 354  static int fbf_load_font_file(const char Line 354  static int fbf_load_font_file(const char
354  int fbf_render_init(const char *font_path)  int fbf_render_init(const char *font_path)
355  {  {
356      FindFileState *ffs;      FindFileState *ffs;
357      char filename[1024];      char filename[MAX_FILENAME_SIZE];
358    
359      glyph_cache_init();      glyph_cache_init();
360      first_font = NULL;      first_font = NULL;
# Line 363  int fbf_render_init(const char *font_pat Line 363  int fbf_render_init(const char *font_pat
363      if (!ffs)      if (!ffs)
364          return -1;          return -1;
365    
366      for(;;) {      for (;;) {
367          if (find_file_next(ffs, filename, sizeof(filename)))          if (find_file_next(ffs, filename, sizeof(filename)))
368              break;              break;
369          if (fbf_load_font_file(filename) < 0) {          if (fbf_load_font_file(filename) < 0) {
# Line 377  void fbf_render_cleanup(void) Line 377  void fbf_render_cleanup(void)
377  {  {
378      UniFontData *uf, *uf1;      UniFontData *uf, *uf1;
379    
380      for(uf = first_font; uf != NULL; uf = uf1) {      for (uf = first_font; uf != NULL; uf = uf1) {
381          uf1 = uf->next_font;          uf1 = uf->next_font;
382          /* close font data structures */          /* close font data structures */
383          fbf_free_font(uf);          fbf_free_font(uf);
# Line 479  int fbf_render_init(const char *font_pat Line 479  int fbf_render_init(const char *font_pat
479    
480      glyph_cache_init();      glyph_cache_init();
481      first_font = NULL;      first_font = NULL;
482      for(pp = fbf_fonts; *pp != NULL; pp += 2) {      for (pp = fbf_fonts; *pp != NULL; pp += 2) {
483          fbf_load_font_memory(pp[0], (int)pp[1]);          fbf_load_font_memory(pp[0], (int)pp[1]);
484      }      }
485      if (!fallback_font)      if (!fallback_font)
# Line 491  void fbf_render_cleanup(void) Line 491  void fbf_render_cleanup(void)
491  {  {
492      UniFontData *uf, *uf1;      UniFontData *uf, *uf1;
493    
494      for(uf = first_font; uf != NULL; uf = uf1) {      for (uf = first_font; uf != NULL; uf = uf1) {
495          uf1 = uf->next_font;          uf1 = uf->next_font;
496          /* close font data structures */          /* close font data structures */
497          fbf_free_font(uf);          fbf_free_font(uf);

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

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