Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SRP_String
It seems SRP_String is for screen display.
Is there any way to convert this to print width, as the Get_Printer function is too slow in OI9.
Or any SRP utility for the same?
Is there any way to convert this to print width, as the Get_Printer function is too slow in OI9.
Or any SRP utility for the same?
Comments
Declare function GetDC, GetDeviceCaps Declare subroutine ReleaseDC Equ LOGPIXELSX$ to 88 Equ LOGPIXELSY$ to 90 hDC = GetDC(0) DpiX = GetDeviceCaps(hDC, LOGPIXELSX$) DpiY = GetDeviceCaps(hDC, LOGPIXELSY$) ReleaseDC( 0, hDC )
Use DpiX to adjust width and DpiY to adjust height.
When I divide the returned string width by the DPI, I get a value approx 1.3 times less than what I get with the OIPI calc text function. Is there some relationship I am not seeing.
I can factor this by the 1.3 (1.2996etc) to get a good approximation however.
This is exciting, as it is 50+ times faster than doing it in OIPI.
The help text is less that useful.
Any idea what unit the Wrap width and the return values are in. Pixels?
Looking at some old SRP documentation examples this does not seem to be the case.
Would be great if this did it for you as it suggests. Do you have a working example?
TextRect = Utility("TEXTRECT", "", Text :@FM: (0 + 1024 + 16) :@FM: 640 :@FM: Font)
... where 'Text' is the text you'd like to compute, and 'Font' is a normal @SVM delimited font description array, TextRect<1> will be the width in 'units'.
The conversion is 70.612 units per inch.
I tried the command but it does not return CRLF delimiters in the text, despite the DT_WORDBREAK (16) set.
I will continue testing