- Timestamp:
- Apr 29, 2006, 2:09:26 AM (19 years ago)
- Location:
- trunk/src/lib/graphics/text_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/font.cc
r7430 r7431 381 381 &adv) == -1) 382 382 return false; 383 384 383 glyph->minX = (float)miX / (float)this->renderSize; 385 384 glyph->maxX = (float)maX / (float)this->renderSize; … … 393 392 glyph->bearingX = (glyph->advance - glyph->width) / 2; 394 393 glyph->bearingY = glyph->maxY; 394 395 //printf("%c:: %d %d %d %d %d\n", character, miX, maX, miY, maY, adv); 396 395 397 return true; 396 398 } … … 471 473 { 472 474 SDL_SetAlpha(glyphSurf, 0, 0); 473 int tmp = tmpRect.y;475 int tmpY = tmpRect.y; 474 476 tmpRect.y += this->getMaxAscent()-(int)((float)tmpGlyph->bearingY*this->renderSize); 475 477 SDL_BlitSurface(glyphSurf, NULL, tmpSurf, &tmpRect); 476 tmpRect.y = tmp ;477 478 tmpGlyph->texCoord[0] = (float)((float)tmpRect.x + tmpGlyph->minX*(float)this->renderSize)/(float)tmpSurf->w;479 tmpGlyph->texCoord[1] = (float)((float)tmpRect.x + tmpGlyph-> maxX*(float)this->renderSize)/(float)tmpSurf->w;478 tmpRect.y = tmpY; 479 480 tmpGlyph->texCoord[0] = (float)((float)tmpRect.x )/(float)tmpSurf->w; 481 tmpGlyph->texCoord[1] = (float)((float)tmpRect.x + tmpGlyph->width*(float)this->renderSize)/(float)tmpSurf->w; 480 482 tmpGlyph->texCoord[2] = (float)(tmpRect.y)/(float)tmpSurf->w; 481 483 tmpGlyph->texCoord[3] = (float)((float)tmpRect.y+(float)this->getMaxHeight())/(float)tmpSurf->w; 482 484 SDL_FreeSurface(glyphSurf); 483 tmpRect.x += glyphSurf->w+1; //(int)(tmpGlyph->advance * this->renderSize);485 tmpRect.x += (int)(tmpGlyph->width * this->renderSize) + 1; 484 486 } 485 487 } 486 488 } 487 489 // outputting the GLYPH-table 488 //char outName[1024];489 //sprintf( outName, "%s-glyphs.bmp", this->getName());490 //SDL_SaveBMP(tmpSurf, outName);490 char outName[1024]; 491 sprintf( outName, "%s-glyphs.bmp", this->getName()); 492 SDL_SaveBMP(tmpSurf, outName); 491 493 492 494 if (this->setSurface(tmpSurf)) -
trunk/src/lib/graphics/text_engine/text.cc
r7429 r7431 164 164 { 165 165 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); 166 glVertex2d(posX+tmpGlyph-> advance*this->getSizeY2D(), 0);166 glVertex2d(posX+tmpGlyph->maxX*this->getSizeY2D(), 0); 167 167 168 168 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]); 169 glVertex2d(posX+tmpGlyph-> advance*this->getSizeY2D(), this->getSizeY2D());169 glVertex2d(posX+tmpGlyph->maxX*this->getSizeY2D(), this->getSizeY2D()); 170 170 171 171 glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
Note: See TracChangeset
for help on using the changeset viewer.