+ void GenerateUnderlines( std::vector< MeshRecord >& meshRecords,
+ Vector< Extent >& extents,
+ const Vector4& underlineColor,
+ const Vector4& textColor )
+ {
+ AtlasManager::Mesh2D newMesh;
+ unsigned short faceIndex = 0;
+ for ( Vector< Extent >::ConstIterator eIt = extents.Begin(),
+ eEndIt = extents.End();
+ eIt != eEndIt;
+ ++eIt )
+ {
+ AtlasManager::Vertex2D vert;
+ uint32_t index = eIt->mMeshRecordIndex;
+ Vector2 uv = mGlyphManager.GetAtlasSize( meshRecords[ index ].mAtlasId );
+
+ // Make sure we don't hit texture edge for single pixel texture ( filled pixel is in top left of every atlas )
+ float u = HALF / uv.x;
+ float v = HALF / uv.y;
+ float thickness = eIt->mUnderlineThickness;
+ float baseLine = eIt->mBaseLine + eIt->mUnderlinePosition - ( thickness * HALF );
+ float tlx = eIt->mLeft;
+ float brx = eIt->mRight;
+
+ vert.mPosition.x = tlx;
+ vert.mPosition.y = baseLine;
+ vert.mTexCoords.x = ZERO;
+ vert.mTexCoords.y = ZERO;
+ newMesh.mVertices.PushBack( vert );
+
+ vert.mPosition.x = brx;
+ vert.mPosition.y = baseLine;
+ vert.mTexCoords.x = u;
+ newMesh.mVertices.PushBack( vert );
+
+ vert.mPosition.x = tlx;
+ vert.mPosition.y = baseLine + thickness;
+ vert.mTexCoords.x = ZERO;
+ vert.mTexCoords.y = v;
+ newMesh.mVertices.PushBack( vert );
+
+ vert.mPosition.x = brx;
+ vert.mPosition.y = baseLine + thickness;
+ vert.mTexCoords.x = u;
+ newMesh.mVertices.PushBack( vert );
+
+ // Six indices in counter clockwise winding
+ newMesh.mIndices.PushBack( faceIndex + 1u );
+ newMesh.mIndices.PushBack( faceIndex );
+ newMesh.mIndices.PushBack( faceIndex + 2u );
+ newMesh.mIndices.PushBack( faceIndex + 2u );
+ newMesh.mIndices.PushBack( faceIndex + 3u );
+ newMesh.mIndices.PushBack( faceIndex + 1u );
+ faceIndex += 4;
+
+ if ( underlineColor == textColor )
+ {
+ mGlyphManager.StitchMesh( meshRecords[ index ].mMesh, newMesh );
+ }
+ else
+ {
+ MeshRecord record;
+ record.mMesh = newMesh;
+ record.mAtlasId = meshRecords[ index ].mAtlasId;
+ record.mColor = underlineColor;
+ meshRecords.push_back( record );
+ }
+ }
+ }
+
+ Actor GenerateShadow( MeshRecord& meshRecord,
+ const Vector2& actorSize,
+ const Vector2& shadowOffset,
+ const Vector4& shadowColor )