It is currently Mon Apr 24, 2017 2:13 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: Shader VMK 82 - Font File Class
PostPosted: Sat Apr 25, 2015 6:44 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
In this video I show how to implement the Font File class used to store data for different fonts which are loaded using the Font Manager.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 82 - Font File Class
PostPosted: Sun Apr 26, 2015 2:25 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
Inside the constructor for the FontFile towards the bottom where you have the 4 checks for the correct sizes, when you were explaining the logic to the code, you did not scroll the screen towards the right, and was not able to see the rest of the 4 error messages that the ExceptionHandler will throw.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 82 - Font File Class
PostPosted: Sun Apr 26, 2015 7:58 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
Here are the parts that got cut off in the video

if( glyph.topLeftCoord.x > _atlasTextureInfo.size.x && glyph.topLeftCoord.x != static_cast<unsigned short>( -1 ) ) {
   std::ostringstream strStream;
   strStream << __FUNCTION__ << " (Top Left).x texture coordinate(" << glyph.topLeftCoord.x << ") for glyph (" << characterCode << ") in " << vFontData[f].strFontName << " is out of range (" << _atlasTextureInfo.size.x << ")";
   throw ExceptionHandler( strStream );

} else if( glyph.topLeftCoord.y > _atlasTextureInfo.size.y && glyph.topLeftCoord.y != static_cast<unsigned short>( -1 ) ) {
   std::ostringstream strStream;
   strStream << __FUNCTION__ << " (Top Left).y texture coordinate(" << glyph.topLeftCoord.y << ") for glyph (" << characterCode << ") in " << vFontData[f].strFontName << " is out of range (" << _atlasTextureInfo.size.y << ")";
   throw ExceptionHandler( strStream );

} else if( glyph.topLeftCoord.x + glyph.size.x > _atlasTextureInfo.size.x && glyph.size.x != 0 ) {
   std::ostringstream strStream;
   strStream << __FUNCTION__ << " (Bottom Right).x texture coordinate(" << ( glyph.topLeftCoord.x + glyph.size.x ) << ") for glyph (" << characterCode << ") in " << vFontData[f].strFontName << " is out of range (" << _atlasTextureInfo.size.x << ")";
   throw ExceptionHandler( strStream );

} else if( glyph.topLeftCoord.y + glyph.size.y > _atlasTextureInfo.size.y && glyph.size.y != 0 ) {
   std::ostringstream strStream;
   strStream << __FUNCTION__ << " (Bottom Right).y texture coordinate(" << ( glyph.topLeftCoord.y + glyph.size.y ) << ") for glyph (" << characterCode << ") in " << vFontData[f].strFontName << " is out of range (" << _atlasTextureInfo.size.y << ")";
   throw ExceptionHandler( strStream );
}


Offline
 Profile  
 
 Post subject: Re: Shader VMK 82 - Font File Class
PostPosted: Sun Apr 26, 2015 9:39 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 447
Now I feel much better knowing that when we begin to debug and test the up coming code, I know I will be getting the correct error messages! :) Can not wait to render some text!


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron