Changeset 403 for trunk/src/gfx/texture_font.cc
- Timestamp:
- 06/14/15 14:31:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/texture_font.cc
r399 r403 11 11 12 12 using namespace nv; 13 14 #define NV_CHECK_FREETYPE_ERROR( error, ... ) \ 15 if ( error != 0 ) { \ 16 NV_LOG_CRITICAL( "freetype : ", __VA_ARGS__ ); \ 17 NV_ABORT( "freetype : freetype library error!" ); \ 18 } 13 19 14 20 texture_glyph::texture_glyph() … … 45 51 46 52 error = FT_Init_FreeType( (FT_Library*)(&m_rlibrary) ); 47 if ( error ) NV_THROW( std::runtime_error, "FT_Error");53 NV_CHECK_FREETYPE_ERROR( error, "error on FT_Init_FreeType, code - ", error ); 48 54 49 55 error = FT_New_Face( (FT_Library)(m_rlibrary), filename, 0, (FT_Face*)(&m_rface) ); 50 if ( error ) NV_THROW( std::runtime_error, "FT_Error");56 NV_CHECK_FREETYPE_ERROR( error, "error on FT_New_Face, code - ", error ); 51 57 52 58 error = FT_Set_Char_Size( (FT_Face)(m_rface), (int)(size*64), 0, 72*64, 72 ); 53 if ( error ) NV_THROW( std::runtime_error, "FT_Error");59 NV_CHECK_FREETYPE_ERROR( error, "error on FT_Set_Char_Size, code - ", error ); 54 60 55 61 FT_Set_Transform( (FT_Face)(m_rface), &matrix, NULL ); … … 123 129 FT_UInt glyph_index = FT_Get_Char_Index( face, c ); 124 130 FT_Error error = FT_Load_Glyph( face, glyph_index, flags ); 125 if ( error ) 126 { 127 NV_LOG_ERROR( "FT_Error while loading glyphs, error: ", error, " code: ", c ); 128 NV_THROW( std::runtime_error, "FT_Error while loading glyphs" ); 129 } 131 NV_CHECK_FREETYPE_ERROR( error, "error on FT_Load_Glyph, gylph '", c ,"' code - ", error ); 130 132 131 133 FT_GlyphSlot slot = face->glyph; … … 141 143 if ( r.pos.x < 0 ) 142 144 { 143 NV_LOG_ ERROR( "Atlas full while loading glyphs, r.pos.x: ", r.pos.x, " code: ", c);144 NV_ THROW( std::runtime_error, "Atlas full while loading glyphs" );145 NV_LOG_CRITICAL( "texture_font : atlas full while loading glyphs, gylph '", c, "' r.pos.x = ", r.pos.x ); 146 NV_ABORT( "texture_font : atlas full while loading gylphs!" ); 145 147 } 146 148 if (depth == 4)
Note: See TracChangeset
for help on using the changeset viewer.