/[gzz]/gzz/gfx/libtext/Text.hxx
ViewVC logotype

Diff of /gzz/gfx/libtext/Text.hxx

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

revision 1.7 by tjl, Thu Sep 12 15:30:04 2002 UTC revision 1.8 by tjl, Sat Sep 28 09:16:46 2002 UTC
# Line 156  namespace Text { Line 156  namespace Text {
156          QuadGlyph() {}          QuadGlyph() {}
157          QuadGlyph(Glyph glyph, Rect &rect) : glyph(glyph), rect(rect) { }          QuadGlyph(Glyph glyph, Rect &rect) : glyph(glyph), rect(rect) { }
158          bool valid() { return rect.tex.isGood() ; }          bool valid() { return rect.tex.isGood() ; }
159          template<class Vertex> void draw(int &cx, int &cy, Vertex &vertex) {          template<class Vertex> void draw(float &cx, float &cy, Vertex &vertex) {
160              if(glyph.extents.width != 0) {              if(glyph.extents.width != 0) {
161                  int cx1 = cx + glyph.extents.left;                  float cx1 = cx + glyph.extents.left;
162                  int cy1 = cy + glyph.extents.top;                  float cy1 = cy + glyph.extents.top;
163                  int cx2 = cx1 + glyph.extents.width;                  float cx2 = cx1 + glyph.extents.width;
164                  int cy2 = cy1 + glyph.extents.height;                  float cy2 = cy1 + glyph.extents.height;
165                  rect.texcoord(0, 0);                  rect.texcoord(0, 0);
166                  vertex(cx1, cy1);                  vertex(cx1, cy1);
167                  rect.texcoord(0, 1);                  rect.texcoord(0, 1);
# Line 247  namespace Text { Line 247  namespace Text {
247          /** Render a single character.          /** Render a single character.
248           * @return New x position.           * @return New x position.
249           */           */
250          template<class Vertex> int renderChar(Char c, int x, int y, Vertex &vertex)          template<class Vertex> float renderChar(Char c, float x, float y, Vertex &vertex)
251          { // returns new x pos          { // returns new x pos
252              QuadGlyph &glyph = g[(unsigned)c];              QuadGlyph &glyph = g[(unsigned)c];
253              if(!glyph.valid()) return x;              if(!glyph.valid()) return x;
# Line 273  namespace Text { Line 273  namespace Text {
273       * all vertex commands are routed through the Vertex object.       * all vertex commands are routed through the Vertex object.
274       */       */
275      template<class Iterator, class RandomRenderer, class Vertex>      template<class Iterator, class RandomRenderer, class Vertex>
276          int renderIter(          float renderIter(
277                  RandomRenderer &r,                  RandomRenderer &r,
278                  Iterator begin, Iterator end,                  Iterator begin, Iterator end,
279                  int x, int y,                  float x, float y,
280                  Vertex &vertex) {                  Vertex &vertex) {
281          r.startRendering();          r.startRendering();
282          while(begin != end) {          while(begin != end) {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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