Skip to content

Text rendering functions that start with ege_ don't handle vertical text justify and stop working randomly. ege_开头的文本渲染函数没有处理垂直对齐并且随机失效 #256

@Yqloss

Description

@Yqloss

EGE Version EGE版本:ege24.04_all 官网推荐版
Windows Version Windows版本:Windows 11 Home
Compiler 编译器:w64devkit gcc 14.2.0
Compilation Parameters 编译参数:-std=gnu++20 -lgraphics -lgdiplus -luuid -lmsimg32 -lgdi32 -limm32 -lole32 -loleaut32 -lwinmm

ege::initgraph(640, 480, 0);
ege::settextjustify(ege::CENTER_TEXT, ege::CENTER_TEXT);
ege::line(100, 100, 150, 100); // connects centers of the two texts 连接两段文本的中心
ege::outtextxy(100, 100, L"Hello"); // left, normal rendering function 左边 普通渲染函数
ege::ege_outtextxy(150, 100, L"Hello"); // right, ege rendering function 右边 ege渲染函数
ege::getch();

Running the code I found the right text was lower than the left one, and the line was above the right text, which meant the vertical justify didn't even work. More magically, the right text was OFTEN not rendered. (Horizontal justify worked as expected)

运行程序可以发现右边的文字比左边的低,而且直线在右边文字的上方,说明垂直对齐根本没有生效。更神奇的是右边的文字有很大几率无法显示。(水平对齐是没问题的)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions