diff --git a/client/shader_src/ui_text.vert b/client/shader_src/ui_text.vert index 247ea52..f24395f 100644 --- a/client/shader_src/ui_text.vert +++ b/client/shader_src/ui_text.vert @@ -57,7 +57,7 @@ void main() { float fragU = inVertexPosition.x * symbol.width/font.width; float fragV = inVertexPosition.y * symbol.height/font.height; float x = (inVertexPosition.x * symbol.width + symbol.left) * character.size / font.width; - float y = (inVertexPosition.y * symbol.height + symbol.top) * character.size / font.height; + float y = (inVertexPosition.y * symbol.height - symbol.top) * character.size / font.height; fragUV = vec2(fragU, fragV); fragColor = character.color; diff --git a/client/src/pipeline.c b/client/src/pipeline.c index 3562f14..bf75324 100644 --- a/client/src/pipeline.c +++ b/client/src/pipeline.c @@ -496,7 +496,7 @@ VkResult load_font(VkDevice device, VmaAllocator allocator, VkDescriptorSetLayou symbols[i].width = width; symbols[i].height = height; symbols[i].left = face->glyph->bitmap_left; - symbols[i].top = ((face->bbox.yMax*size)/face->units_per_EM) - face->glyph->bitmap_top; + symbols[i].top = face->glyph->bitmap_top; symbols[i].advance = face->glyph->advance.x*16/face->units_per_EM; max_width = width > max_width ? width : max_width; max_height = height > max_height ? height : max_height;