View Issue Details

IDProjectCategoryView StatusLast Update
0003135Multi Theft Auto : San AndreasGUI / Menus / Consolepublic2011-04-17 16:16
ReporterLucif3rAssigned ToTalidan 
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Versionmtasadm_v1.0-dp2 
Target Version1.1Fixed in Version1.1 
Summary0003135: guiLabelGetFontHeight does not work for sa-header and gothic font
Description

Its probably the same issue as #2880. This is causing my labels to cover the gui in battlefield more than necessary.

Additional Information

addCommandHandler ("text", function ()
local l1 = guiCreateLabel(10, 200, 400, 0, 'Test text test text', false)
local w1 = guiLabelGetFontHeight(l1)
outputConsole('height 1: ' .. w1)
guiSetSize(l1, 400, w1, false)
local l2 = guiCreateLabel(10, 300, 400, 0, 'Test text test text', false)
guiSetFont(l2, 'sa-gothic')
local w2 = guiLabelGetFontHeight(l2)
outputConsole('height 2: ' .. w2)
guiSetSize(l2, 400, w2, false)
end)

this code can be executed by starting 'snake' resource, and type /text in the chatbox, or text in console.

TagsNo tags attached.

Relationships

related to 0002880 resolvedChrML guiLabelGetTextExtent ignores the font of the label 

Activities

IJs

2009-09-12 16:28

administrator   ~~0010458

Please test in 1.0 asap.

Mr.Hankey

2009-09-14 15:52

reporter   ~~0010490

Still occurs.

IJs

2009-09-20 17:34

administrator   ~~0010521

CGUI contains a hack that adds 2.0 units to the font height for some reason. If we ignore this hack, the problem could just be caused by CEGUI.

There is another CEGUI function called CEGUI::Font::getBaseline that "Returns the number of pixels from the top of the highest glyph to the baseline.". It may be more suitable for what we're doing, looking at that hack.

Talidan

2011-04-17 16:16

administrator   ~~0013194

This had nothing to do with the problems described above, rather it is almost identical to #2880 in that it always returned the height of default-normal font due to a coding mishap.

Issue History

Date Modified Username Field Change