paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/include pgdraw.h,1.4.2.11,1.4.2.12 pgfont.h,


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/include pgdraw.h,1.4.2.11,1.4.2.12 pgfont.h,1.4.2.3,1.4.2.4
Date: Mon, 14 Apr 2003 05:11:53 -0400

Update of /cvsroot/paragui/paragui/include
In directory subversions:/tmp/cvs-serv31546/include

Modified Files:
      Tag: devel-opengl
        pgdraw.h pgfont.h 
Log Message:
various fixes and some new ideas that look to be useful


Index: pgdraw.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/pgdraw.h,v
retrieving revision 1.4.2.11
retrieving revision 1.4.2.12
diff -C2 -r1.4.2.11 -r1.4.2.12
*** pgdraw.h    3 Feb 2003 16:39:59 -0000       1.4.2.11
--- pgdraw.h    14 Apr 2003 09:11:49 -0000      1.4.2.12
***************
*** 95,98 ****
--- 95,100 ----
       virtual Uint32 GetReadFrame() const;
       virtual Uint32 GetWriteFrame() const;
+      virtual PG_Rect GetRect() const
+        { return PG_Rect(my_xpos,my_ypos,my_width,my_height); };
  
       /**

Index: pgfont.h
===================================================================
RCS file: /cvsroot/paragui/paragui/include/pgfont.h,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -C2 -r1.4.2.3 -r1.4.2.4
*** pgfont.h    7 Oct 2002 22:23:26 -0000       1.4.2.3
--- pgfont.h    14 Apr 2003 09:11:50 -0000      1.4.2.4
***************
*** 60,63 ****
--- 60,122 ----
  
  /**
+       @short C++ Encapsulation of Glyphs
+ */
+ 
+ class PG_Font;
+ class DECLSPEC PG_Glyph {
+   /**
+      index of character in font (normally this is the Unicode character)
+   */
+  public:
+   PG_Glyph() { };
+ 
+  private:
+   PG_Font* font;
+   unsigned int index;
+   float ascend;
+   float descend;
+   float width;
+   float leading;
+ };
+ 
+ /**
+    This object contains a string meant for display.  Handles communication
+    with internal fontcache and other bookkeeping necessary for proper display
+    of string.
+    FIXME: add language support
+    FIXME: also string-layout module loader (for Arabic, Japanese, ...)
+    current default is right-to-left, unicode normal display.
+    @short C++ Encapsulation of displayable string for easy render
+ */
+ 
+ class DECLSPEC PG_DisplayString {
+  private:
+   PG_Font* font;
+   std::string text;
+  public:
+   PG_DisplayString(const char* txt = "") : text(txt) {};
+   PG_DisplayString(std::string txt) : text(txt) {};
+ 
+   void setFont(PG_Font* f);
+   PG_Font* getFont();
+ 
+   /**
+      FIXME
+      get ascend, descend, width and leading from the entire string
+   */
+   float getAscend() { return 2.0; };
+   float getDescend() { return 1.0; };
+   float getWidth() { return text.size() * 12.0; };
+   float getLeading() { return 3.0; };
+ 
+   /**
+      Render the text to the surface given
+      @param surface   Surface to draw to.
+      @param rect      Rectangle to draw in, relative to surface.
+   */
+   void draw(PG_Draw::PG_DrawableSurface* surface, const PG_Rect& rect);
+ };
+ 
+ /**
        @short font description class
  
***************
*** 80,87 ****
--- 139,148 ----
        
        /**
+       Get the average ascent of the font
        */
        int GetFontAscender();
  
        /**
+       Get the average descent of the font
        */
        int GetFontDescender();
***************
*** 162,166 ****
        friend class PG_FontEngine;
  };
- 
  
  /**
--- 223,226 ----





reply via email to

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