FontMesh.cpp
Go to the documentation of this file.
48 FontMesh::Geometry FontMesh::ComputeGeometry( std::string const & text, float font_size, Location const & location )
162 void FontMesh::GenerateMesh( std::string const & text, float font_size, Location const & location )
181 this->variant_texcoordDensity = float2( 1.0f / tex_size.x, 1.0f / tex_size.y ) * variant_size / font_size;
190 this->cm.log( SRC_INFO, Defs::Log::Text_Verbose, "GenerateMesh, location.size: ", location.size, " location.line_state.basepoint: ", location.line_state.basepoint );
257 this->cm.log( SRC_INFO, Defs::Log::Text_Verbose, "Newline because basepoint ", state.basepoint.x, " remainder advance ", state.preadvance, " and glyph width ", glyph_width, " exceed available size ", location.size.x, "." );
290 float pos_left = state.basepoint.x + state.preadvance + glyph.bearing_x * font_size / variant_size;
347 this->cm.log( SRC_INFO, Defs::Log::Text_Verbose, "Glyph generated on ( ", pos_left, ", ", pos_top, " ) - ( ", pos_right, ", ", pos_bottom, " )", Context::Endl(),
351 this->cm.log( SRC_INFO, Defs::Log::Text_Verbose, "Advance by remainder ", state.preadvance, " and glyph width ", glyph_width, "." );
361 void FontMesh::Render( CameraState const & camera, float4x4 const & model_transform, float4 color, float4 preblend, bool translucent, std::optional< float > depth_override, ShaderScissor const & scissor )
366 params.colorTransform.Set( ColorTransform::Shift( float4( color.r, color.g, color.b, 1.0f ) ) * ColorTransform::Zero() );