Don't use Harfbuzz for simple text rendering + Ignored warnings

This commit is contained in:
Simon Lübeß
2022-01-15 13:29:45 +01:00
parent 3c1897b926
commit ee9dfd4593
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -671,7 +671,7 @@ namespace GlitchyEngine.Renderer.Text
shape.Normalize(); shape.Normalize();
var bounds = shape.GetBounds(); //var bounds = shape.GetBounds();
//shape.ReverseIfNeeded(bounds); //shape.ReverseIfNeeded(bounds);
@@ -457,7 +457,8 @@ namespace GlitchyEngine.Renderer.Text
// about 8 million (2^23) increments to reach a depth of 1 so I think it's safe enough. // about 8 million (2^23) increments to reach a depth of 1 so I think it's safe enough.
//float f = 1.0f; //float f = 1.0f;
//int32 depthInt = *(int32*)&f; //int32 depthInt = *(int32*)&f;
/*
// Shape!!!!!!!!!!!!!!!!!!! // Shape!!!!!!!!!!!!!!!!!!!
// 1. Create a buffer and put your text in it: // 1. Create a buffer and put your text in it:
@@ -469,7 +470,7 @@ namespace GlitchyEngine.Renderer.Text
hb_buffer_set_direction(buf, .HB_DIRECTION_LTR); hb_buffer_set_direction(buf, .HB_DIRECTION_LTR);
hb_buffer_set_script(buf, .HB_SCRIPT_LATIN); hb_buffer_set_script(buf, .HB_SCRIPT_LATIN);
hb_buffer_set_language(buf, hb_language_from_string("en".CStr(), -1)); hb_buffer_set_language(buf, hb_language_from_string("en".CStr(), -1));
// 3. Get the face // 3. Get the face
hb_font_t* hb_font = font._harfBuzzFont; hb_font_t* hb_font = font._harfBuzzFont;
@@ -561,7 +562,8 @@ namespace GlitchyEngine.Renderer.Text
penPosition += (x_advance / 64) * glyphFontScale; penPosition += (x_advance / 64) * glyphFontScale;
baseline += (y_advance / 64) * glyphFontScale; baseline += (y_advance / 64) * glyphFontScale;
} }
/* */
// enumerate through the unicode codepoints // enumerate through the unicode codepoints
for(char32 char in text.DecodedChars) for(char32 char in text.DecodedChars)
{ {
@@ -635,7 +637,7 @@ namespace GlitchyEngine.Renderer.Text
// Increase depth for the next glyph // Increase depth for the next glyph
//depthInt--; //depthInt--;
} }
*/
Renderer2D.Flush(); Renderer2D.Flush();
// TODO: not good! // TODO: not good!