Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools
Old 02-23-2022, 09:32 PM   #1
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,090
Default gfx.drawstr multiple new line "\n" - Changed the behavior after 6.43 (FIXED)

gfx.drawstr changed the behavior in 6.43 and is not in the reascript changelog.

Before: Many \n in sequence would go to a new line, like printing in the console

After: Many \n in sequence are ignored and only one used

Affected some scripts like Lokasenna GUI Text Editor Object got broken because relied in empty lines created by passing multiple "\n".

This seems to happen only is some fonts:

Script for reproduce :

Code:
 
local function Main()

	local char = gfx.getchar()
	if char ~= 27 and char ~= -1 then
		reaper.defer(Main)
	end

    gfx.setfont(0)
    gfx.x, gfx.y = 0, 0
    gfx.drawstr(text)	


    gfx.setfont(1,"Arial", 20 )
    gfx.x, gfx.y = 150, 0
    gfx.drawstr(text)

	gfx.update()

end
text = '\n\nLINE\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLINE'
gfx.init("My Window", 640, 480, 0, 200, 200)
Main()



6.43 CHANGELOG:
Code:
ReaScript: add bandpass type to TrackFX_SetEQParam, etc
ReaScript: Envelope_GetParentTrack/Take always return index/index2 in Lua
ReaScript: Fix GetUserFileNameForRead() when called with forward slashes on Windows .
ReaScript: GetEnvelopePointEx/GetEnvelopePoint/Envelope_Evaluate always return all output parameters in Lua
ReaScript: improve ident strings for VST plug-ins (include VST2 and VST3 IDs)
ReaScript: Lua functions do not type-check parameters which are output-only
ReaScript: make output-only parameters optional in EEL2 when possible
ReaScript: ReaLimit supports Track/TakeFX_Get/SetNamedConfigParm for THRESHOLD, CEILING, TRUEPEAK
ReaScript: save/load script and "P_EXT:" extension data for the master track .
ReaScript: TimeMap_curFrameRate() always returns dropFrame in Lua
ReaScript: Track/TakeFX_GetPinMappings/IOSize always return all outputs in Lua
daniellumertz is offline   Reply With Quote
Old 02-23-2022, 09:33 PM   #2
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,090
Default

PS: Funny the name of 6.43 version is "Everything is Broken"
daniellumertz is offline   Reply With Quote
Old 02-24-2022, 02:33 AM   #3
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,761
Default

Confirmed on Windows 10, Reaper v6.49/x64

This breaks a lot of scripts of the community.
__________________
Most of my scripts are available on ReaPack. If you find them valuable, your support through a donation is greatly appreciated. Thank you! :)
amagalma is offline   Reply With Quote
Old 02-24-2022, 03:50 AM   #4
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 16,954
Default

Fixing, thanks for the report. It's a lame workaround, but if you render a string with a space in it first, or just render a string that is a single space, then the newlines should be rendered properly.
schwa is offline   Reply With Quote
Old 02-24-2022, 05:01 AM   #5
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,761
Default

Thanks Schwa!

I think we shall wait for the fix instead of changing tens of scripts to work around this
__________________
Most of my scripts are available on ReaPack. If you find them valuable, your support through a donation is greatly appreciated. Thank you! :)
amagalma is offline   Reply With Quote
Old 02-24-2022, 08:43 AM   #6
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,090
Default

Thanks schwa good to know it is going to be fixed
daniellumertz is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.