It is currently March 28th, 2024, 5:03 pm

ellipsis placement via clipstring option

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
2bndy5
Posts: 20
Joined: February 25th, 2015, 2:38 am

ellipsis placement via clipstring option

Post by 2bndy5 »

My idea I want to contribute is letting the user specify the location of the ellipsis in the string of a meter by setting the clipstring option to 3 (for middle of string) or 4 (beginning of string).I've been looking at the source code for about a week now... It looks like I could modify trimming object (defined on line 399 of TextFormatD2D.cpp) to include a delimiter and delimiter count (starting from end of string). Therefore anything after the specified delimiter would be preserved and displayed after the ellipsis. MSDN Documentation

The clipstring option gets passed from MeterString.cpp onto TextFormatD2D.cpp via DrawString() but in the form of a boolean. It looks like the Boolean then determines the granularity argument of DWRITE_TRIMMING to Character (true) or none (false).

My thinking is if clipstring > 2 then set delimiting character and delimiter count (based on middle or beginning of string) and pass them along with the pre-existing Boolean from DrawSting(). I guess my question is: Should I create a DWRITE_TRIMMING object within DrawString() of MeterString.cpp or modify SetTrimming() within TextFormatD2D.cpp?
Furthermore, how do I determine the amount of characters displayed after clipping is applied? Is there a function in D2D that would help calculate this?
User avatar
2bndy5
Posts: 20
Joined: February 25th, 2015, 2:38 am

Re: ellipsis placement via clipstring option

Post by 2bndy5 »

abandoned goal. preliminary test seemed to break clipstring functionality all together. :yawn:
Post Reply