Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26738/src

Modified Files:
        osd.py 
Log Message:
move skin font handling to osd to avoid duplicate code

Index: osd.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/osd.py,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -d -r1.121 -r1.122
*** osd.py      11 Jan 2004 20:01:28 -0000      1.121
--- osd.py      11 Jan 2004 20:23:31 -0000      1.122
***************
*** 11,14 ****
--- 11,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.122  2004/01/11 20:23:31  dischi
+ # move skin font handling to osd to avoid duplicate code
+ #
  # Revision 1.121  2004/01/11 20:01:28  dischi
  # make bmovl work again
***************
*** 788,792 ****
      def drawstringframed(self, string, x, y, width, height, font, fgcolor=None,
                           bgcolor=None, align_h='left', align_v='top', mode='hard',
!                          shadow=None, border_color=None, layer=None, ellipses='...'):
          """
          draws a string (text) in a frame. This tries to fit the
--- 791,795 ----
      def drawstringframed(self, string, x, y, width, height, font, fgcolor=None,
                           bgcolor=None, align_h='left', align_v='top', mode='hard',
!                          layer=None, ellipses='...'):
          """
          draws a string (text) in a frame. This tries to fit the
***************
*** 807,828 ****
          - mode: the way we should break lines/truncate. Can be 'hard'(based on chars)
            or 'soft' (based on words)
-         - shadow can be a list of (x, y, color)
-         - border_color is a border around the text.
- 
-         You can't use border_color and shadow at the same time
          """
          if not string:
              return '', (x,y,x,y)
  
!         if shadow:
!             shadow_x, shadow_y = shadow[:2]
!         else:
!             shadow_x = 0
!             shadow_y = 0
! 
          border_radius = 0
!         if border_color != None:
!             border_radius = int(font.ptsize/10)
!             
          if height == -1:
              height = font.height
--- 810,838 ----
          - mode: the way we should break lines/truncate. Can be 'hard'(based on chars)
            or 'soft' (based on words)
          """
          if not string:
              return '', (x,y,x,y)
  
!         shadow_x      = 0
!         shadow_y      = 0
!         border_color  = None
          border_radius = 0
! 
!         if hasattr(font, 'shadow'):
!             # skin font
!             if font.shadow.visible:
!                 if font.shadow.border:
!                     border_color  = font.shadow.color
!                     border_radius = int(font.font.ptsize/10)
!                 else:
!                     shadow_x     = font.shadow.y
!                     shadow_y     = font.shadow.x
!                     shadow_color = self._sdlcol(font.shadow.color)
!             if not fgcolor:
!                 fgcolor = font.color
!             if not bgcolor:
!                 bgcolor = font.bgcolor
!             font    = font.font
! 
          if height == -1:
              height = font.height
***************
*** 896,901 ****
          if layer:
              fgcolor  = self._sdlcol(fgcolor)
-             if shadow:
-                 shadow_color = self._sdlcol(shadow[2])
              if border_color != None:
                  border_color = self._sdlcol(border_color)
--- 906,909 ----
***************
*** 934,938 ****
                                      layer.blit(font.font.render(l, 1, border_color),
                                                 (x0+ox, y0+oy))
!                     if shadow:
                          # draw the text in the shadow_color to get a shadow
                          layer.blit(font.font.render(l, 1, shadow_color),
--- 942,946 ----
                                      layer.blit(font.font.render(l, 1, border_color),
                                                 (x0+ox, y0+oy))
!                     if shadow_x or shadow_y:
                          # draw the text in the shadow_color to get a shadow
                          layer.blit(font.font.render(l, 1, shadow_color),
***************
*** 952,960 ****
          # change max_x, min_x, y and height_needed to reflect the
          # changes from border and shadow
!         if shadow:
              if shadow_x < 0:
                  min_x += shadow_x
              else:
                  max_x += shadow_x
              if shadow_y < 0:
                  y += shadow_y
--- 960,969 ----
          # change max_x, min_x, y and height_needed to reflect the
          # changes from border and shadow
!         if shadow_x:
              if shadow_x < 0:
                  min_x += shadow_x
              else:
                  max_x += shadow_x
+         if shadow_y:
              if shadow_y < 0:
                  y += shadow_y




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to