hello,
I am having trouble formatting strings in the text() function. Maybe a bug, maybe I am just missing something.
I have a hash where i want to format a string so "key : value" with each field the same size and the ":" line up. See code below. Now, the strlens are the same and when printed to the console, everything lines up. But not within the text() box on the image. Why not? Is the font scaleable or something? Am I missing something? Thanks
data = orderedHash('file', 'filename', 'time', timestamp(), 'data type', 'XYZ')
textList = list()
foreach val, data, key do begin
pString = string(key, format = '(A-10)')+": "+string(val, format='(A19)')
;pString = string(format='(%"%15s: %19s")', key, val)
textList->add, pString
print, pString
print, strlen(pString)
endforeach
; Just a graphics window for the text
file = FILEPATH('nyny.dat', $
SUBDIRECTORY = ['examples', 'data'])
nyny = READ_BINARY(file, DATA_DIMS = [768, 512])
im = IMAGE(nyny, RGB_TABLE=36)
imgText = text(.5, .5, textList->toArray(), /fill_background, fill_color = 'white')
|