1
0
forked from mirrors/0ad

Increase text size for capture, health, and resource stats in GUI panels

After FreeType integration in dfb4598186 font height and line spacing
were incorrectly applied. That caused UI elements like capture, health,
and resource stats to appear misaligned or invisible.

Commit c2d529b975 standardized font height usage, removed lineSpace, and
introduced GetCapHeight + Descender for better vertical alignment.

However, affected texts used a font-stroke-12 with a GUI size of 12,
which now renders lower in the container due to stroke and metric
offset. Increasing the size to 14 ensures the text is properly visible
and aligned.

This adjusts for the actual space font-stroke-12 occupies in rendering.

Fixes: #7962
This commit is contained in:
trompetin17
2025-06-04 20:41:56 -05:00
parent 79104db2c5
commit 4524460d9c
2 changed files with 6 additions and 6 deletions
@@ -39,10 +39,10 @@
<!-- Capture bar -->
<object name="captureSection">
<object size="0 0 100% 12" name="captureLabel" type="text" style="StatsTextLeft" ghost="true">
<object size="0 0 100% 14" name="captureLabel" type="text" style="StatsTextLeft" ghost="true">
<translatableAttribute id="tooltip">Capture points</translatableAttribute>
</object>
<object size="0 0 100% 12" name="captureStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="0 0 100% 14" name="captureStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="1 14 100% 21" name="capture" type="image">
<object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
<repeat count="9">
@@ -55,7 +55,7 @@
<!-- Health bar -->
<object name="healthSection">
<object size="0 0 100% 12" name="healthStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="0 0 100% 14" name="healthStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="1 14 100% 21" name="health" type="image" tooltip_style="sessionToolTip">
<object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
<object type="image" sprite="healthBackground" ghost="true"/>
@@ -69,8 +69,8 @@
<!-- Resource bar -->
<object name="resourceSection">
<object size="0 0 100% 12" name="resourceLabel" type="text" style="StatsTextLeft" ghost="true"/>
<object size="0 0 100% 12" name="resourceStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="0 0 100% 14" name="resourceLabel" type="text" style="StatsTextLeft" ghost="true"/>
<object size="0 0 100% 14" name="resourceStats" type="text" style="StatsTextRight" ghost="true"/>
<object size="1 14 100% 21" name="resources" type="image">
<object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
<object type="image" sprite="resourceBackground" ghost="true"/>
@@ -6,7 +6,7 @@
<object name="resource[n]" size="0 0 73 100%" type="button" style="resourceCounter" tooltip_style="sessionToolTip">
<object size="2 0 38 36" type="image" name="resource[n]_icon" ghost="true"/>
<object size="33 4 180 22" type="text" style="resourceText" name="resource[n]_count"/>
<object size="33 1 200 34" type="text" style="gathererCounts" name="resource[n]_stats"/>
<object size="33 20 200 38" type="text" style="gathererCounts" name="resource[n]_stats"/>
</object>
</repeat>
</object>