FT_Int32 nLoadFlags; INT32 nCharCount = strlen( TUIFontImage::charMap ); FT_GlyphSlot pSlot; FT_Bitmap* pBitmap; FT_Int32 nLoadFlags; nLoadFlags = FT_LOAD_RENDER | FT_LOAD_TARGET_MONO; // FT_LOAD_MONOCHROME | FT_LOAD_NO_AUTOHINT; error = FT_Set_Char_Size( m_pFontFace, 0, m_nFontSize << 6, 96, 96 ); if ( error ) { // TODO: } error = FT_Load_Char( m_pFontFace, TUIFontImage::charMap[n] , nLoadFlags ); if (error) continue; // ignore errors pSlot = m_pFontFace->glyph; pBitmap =&pSlot->bitmap; for ( nY = 0; nY < pBitmap->rows; nY++) { for ( nX = 0; nX < pBitmap->width; nX++ ) { readByte = pBitmap->buffer[(nY*pBitmap->pitch) + (nX >> 3)]; nCurIndex = nCharY+nY; nCurIndex *= FONT_TEXTURE_WIDTH << 1; nCurIndex += ( nCharX + nX ) << 1; if ( readByte & ( 0x80 >> (nX & 0x07 ) ) ) { loadBuffer[nCurIndex] = (char)0xFF; loadBuffer[nCurIndex+1] = (char)0xFF; // Full opacity } else { loadBuffer[nCurIndex] = (char)0x00; // Color is irrelevant loadBuffer[nCurIndex+1] = (char)0x00; // zero opacity } } }