+ DALI_LOG_INFO( gLogFilter, Debug::General, "Added glyph, font: %d index: %d\n", glyph.fontId, glyph.index );
+
+ // If glyph added to an existing or new atlas then a new glyph record is required.
+ // Check if an existing atlas will fit the image, create a new one if required.
+ if ( mAtlasManager.Add( bitmap, slot ) )
+ {
+ // A new atlas was created so set the texture set details for the atlas
+ Dali::Texture atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture( 0u, atlas );
+ textureSet.SetSampler( 0u, mSampler);
+ mAtlasManager.SetTextures( slot.mAtlasId, textureSet );
+ }
+
+ GlyphRecordEntry record;
+ record.mIndex = glyph.index;
+ record.mImageId = slot.mImageId;
+ record.mCount = 1;
+ record.mOutlineWidth = style.outline;
+ record.isItalic = style.isItalic;
+ record.isBold = style.isBold;
+
+ // Have glyph records been created for this fontId ?
+ bool foundGlyph = false;
+ for ( std::vector< FontGlyphRecord >::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
+ fontGlyphRecordIt != mFontGlyphRecords.end(); ++fontGlyphRecordIt )
+ {
+ if ( fontGlyphRecordIt->mFontId == glyph.fontId )
+ {
+ fontGlyphRecordIt->mGlyphRecords.PushBack( record );
+ foundGlyph = true;
+ break;
+ }
+ }
+
+ if ( !foundGlyph )
+ {
+ // We need to add a new font entry
+ FontGlyphRecord fontGlyphRecord;
+ fontGlyphRecord.mFontId = glyph.fontId;
+ fontGlyphRecord.mGlyphRecords.PushBack( record );
+ mFontGlyphRecords.push_back( fontGlyphRecord );
+ }