2020-06-02 23:00 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006323Spring engineGeneralpublic2019-10-19 23:22
Assigned ToKloot 
StatusclosedResolutionno change required 
Product Version104.0 +git 
Target VersionFixed in Version104.0 +git 
Summary0006323: Similar font:Print() calls rendered a bit differently on maintenance and develop
DescriptionI'm examining issue when some of the printed text end up being off for similar font:Print() calls on maintenance and develop.

In particular there is a line that draws certain text ("Settings") along with Echo debug in a widget:

Spring.Echo(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on")
font2:Print(title, x-bgMargin+(titleFontSize*0.75), y+bgMargin+8, titleFontSize, "on")

A LOG() call in maintenance:
if (text == "Settings")
  LOG("x=%f, y=%f, sizeX=%f, sizeY=%f, text=%s", x, y, sizeX, sizeY, text.c_str());

And a LOG() call in develop:
if (text=="Settings")
  LOG("x=%f, y=%f, sizeX=%f, sizeY=%f, text=%s", x * globalRendering->screenSizeX, y * globalRendering->screenSizeY, sizeX * globalRendering->screenSizeX, sizeY * globalRendering->screenSizeY, text.c_str());

Both LOG calls happen right before the
RenderString{Outlined, Shadow, ""} block in the CglFont::glPrint() method.

Here's what I get from the LOGs:

Develop (note: actual x, y, xSize, ySize are scaled back to the screen resolution in the LOG() call):
[f=0000212] [Font] x=794.099976, y=793.689209, sizeX=18.000000, sizeY=17.999998, text=Settings

[f=0002152] [Font] x=794.099976, y=793.689209, sizeX=18.000000, sizeY=18.000000, text=Settings

As can be seen both calls look identical, give or take small precision difference. However the end result is quite different. Comparing the two images, it looks like if the develop rendering happens in a bit smaller than actual rendering pane (screenshots are to follow).
TagsNo tags attached.
Checked infolog.txt for ErrorsYes
Attached Files




Kloot (developer)

as explained before, the DrawScreen callin sets up a perspective projection which affects text rendering in maintenance (through the FFP stack) but not in develop. you can use font:SetText{View,Proj}Matrix to correct for this in your wrapper, NCR on the engine side.

-Issue History
Date Modified Username Field Change
2019-10-17 00:52 lhog New Issue
2019-10-17 00:53 lhog File Added: BAR_settings_develop.jpg
2019-10-17 00:53 lhog File Added: BAR_settings_maintenance.jpg
2019-10-19 23:22 Kloot Assigned To => Kloot
2019-10-19 23:22 Kloot Status new => closed
2019-10-19 23:22 Kloot Resolution open => no change required
2019-10-19 23:22 Kloot Fixed in Version => 104.0 +git
2019-10-19 23:22 Kloot Note Added: 0020202
+Issue History