adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src/gui label.cc,1.1.2.3,1.1.2.4 labe


From: VENNIN Joel <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/gui label.cc,1.1.2.3,1.1.2.4 label.h,1.1.2.4,1.1.2.5 label_input.cc,1.1.2.3,1.1.2.4 ttf.cc,1.1.2.2,1.1.2.3
Date: Wed, 05 Mar 2003 05:33:46 -0500

Update of /cvsroot/adonthell/adonthell/src/gui
In directory subversions:/tmp/cvs-serv1671/gui

Modified Files:
      Tag: Branch_road_to_0-4
        label.cc label.h label_input.cc ttf.cc 
Log Message:
Correct the font position (there is always bugs) and the backspace ...



Index: label.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/label.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** label.cc    5 Mar 2003 01:09:26 -0000       1.1.2.3
--- label.cc    5 Mar 2003 10:33:43 -0000       1.1.2.4
***************
*** 85,107 ****
  
  
- void label::add_utf16 (u_int16 c)
- {
-   /*
-   my_old_cursor_ = my_cursor_; 
-   
-   if (my_old_cursor_.idx == my_text_.length ()) 
-     {
-       my_text_ += c;   
-       my_cursor_.idx = my_text_.length (); 
-     }
-   else my_text_.insert (my_cursor_.idx, c);
-   
-   build (false); 
-   */
- 
- }
- 
- 
- 
  /**
     Add text
--- 85,88 ----
***************
*** 178,182 ****
      {
          case NOTHING :
-         std::cout << "label::build\n";
              build_form_nothing (); 
              update_cursor ();
--- 159,162 ----
***************
*** 525,529 ****
      {
        glyph = &((*my_font_) [my_text_[j]]);
!       glyph->my_glyph->draw (tx, ty + glyph->my_yoffset, NULL, this);
        tx += glyph->my_advance; 
      }
--- 505,510 ----
      {
        glyph = &((*my_font_) [my_text_[j]]);
!       //      std::cout << tx << " " <<  ty + glyph->my_yoffset << " " << 
length() << " " << height () << std::endl;
!       glyph->my_glyph->draw (tx + glyph->my_minx + 1 , ty + 
glyph->my_yoffset, NULL, this);
        tx += glyph->my_advance; 
      }
***************
*** 541,546 ****
          {
          glyph = &((*my_font_) [my_text_[j]]);
!             glyph->my_glyph->draw (tx, ty + glyph->my_yoffset, NULL, this);
!             tx += glyph->my_advance; 
          }
          ty += my_font_->height ();
--- 522,530 ----
          {
          glyph = &((*my_font_) [my_text_[j]]);
!         
!         //      std::cout << tx << " " <<  ty + glyph->my_yoffset << " " << 
length() << " " << height () << std::endl;
!         
!         glyph->my_glyph->draw (tx, ty + glyph->my_yoffset, NULL, this);
!         tx += glyph->my_advance; 
          }
          ty += my_font_->height ();

Index: label.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/label.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** label.h     5 Mar 2003 01:09:26 -0000       1.1.2.4
--- label.h     5 Mar 2003 10:33:44 -0000       1.1.2.5
***************
*** 61,70 ****
        
        /**
-        * Add UTF-16
-        */
-       void add_utf16 (u_int16 c);
- 
- 
-       /**
         Set the form of the display
         NOTHING, AUTO_SIZE, AUTO_HEIGHT
--- 61,64 ----

Index: label_input.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/label_input.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** label_input.cc      5 Mar 2003 01:09:26 -0000       1.1.2.3
--- label_input.cc      5 Mar 2003 10:33:44 -0000       1.1.2.4
***************
*** 42,70 ****
  
      while((c=input::get_next_unicode())>0)
!     {
!       std::cout << "Key code: " << c << std::endl;
!         cursor_undraw ();
        
        if (c == SDLK_SPACE) {
          add_text (L" ");
-         std::cout << "Space\n";
        }
!         else if((c == SDLK_BACKSPACE || c == SDLK_DELETE) && my_text_.size () 
>0 && my_cursor_.idx > 0)
!         {    
!             my_text_.erase(--my_cursor_.idx, 1);
!             update_cursor ();
!             my_old_cursor_ = my_cursor_; 
! 
!             lock (); 
!             fillrect (my_cursor_.pos_x, my_cursor_.pos_y,
!                       (*my_font_) [my_text_[my_cursor_.idx]].my_advance,
!                       my_font_->height (), gfx::screen::trans_col ()); 
!             unlock (); 
!             
!             build (false);
!         }
!         else if(c == SDLK_RETURN) add_text (L"\n"); 
!         else if(my_font_->in_table(c)) add_text((wchar_t*)&c); 
!     }  
      return true;
  }
--- 42,69 ----
  
      while((c=input::get_next_unicode())>0)
!       {
!       cursor_undraw ();
        
        if (c == SDLK_SPACE) {
          add_text (L" ");
        }
!       else if((c == SDLK_BACKSPACE || c == SDLK_DELETE) && my_text_.size () 
>0 && my_cursor_.idx > 0)
!         {    
!           wchar_t let = my_text_[my_cursor_.idx-1];
!           my_text_.erase(--my_cursor_.idx, 1);
!           update_cursor ();
!           my_old_cursor_ = my_cursor_; 
!           
!           lock (); 
!           fillrect (my_cursor_.pos_x, my_cursor_.pos_y,
!                     (*my_font_) [let].my_advance,
!                     my_font_->height (), gfx::screen::trans_col ()); 
!           unlock (); 
!           
!           build (false);
!         }
!       else if(c == SDLK_RETURN) add_text (L"\n"); 
!       else if(my_font_->in_table(c)) add_text((wchar_t*)&c); 
!       }  
      return true;
  }

Index: ttf.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gui/Attic/ttf.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** ttf.cc      5 Mar 2003 01:09:26 -0000       1.1.2.2
--- ttf.cc      5 Mar 2003 10:33:44 -0000       1.1.2.3
***************
*** 166,170 ****
  u_int16 ttf::height ()
  {
!   return my_size;
  }
  
--- 166,170 ----
  u_int16 ttf::height ()
  {
!   return my_height;
  }
  
***************
*** 269,273 ****
    my_maxy = FT_FLOOR(metrics->horiBearingY);
    my_miny = my_maxy - FT_CEIL(metrics->height);
!   my_yoffset = ft.my_ascent - my_maxy;
    my_advance = FT_CEIL(metrics->horiAdvance);
  
--- 269,273 ----
    my_maxy = FT_FLOOR(metrics->horiBearingY);
    my_miny = my_maxy - FT_CEIL(metrics->height);
!   my_yoffset = ft.my_ascent - my_maxy + ft.my_descent;
    my_advance = FT_CEIL(metrics->horiAdvance);
  
***************
*** 275,278 ****
--- 275,279 ----
    
    my_glyph = new gfx::image (glyph->bitmap.width, glyph->bitmap.rows);
+   //  my_glyph->set_mask (true);
    ft.copy_bitmap_to_image ( glyph->bitmap.buffer, my_glyph);
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]