[JW Lua] Long-standing bug in GetAdvanceWidthPoints

Simon Leclerc simon at sleclerc.ca
Mon Sep 18 12:38:11 CEST 2023


Hi Robert,

Personally, I would modify the function so it returns the true value and add a note in the docs.

My 2 cents.





¯\_(ツ)_/¯

Simon Leclerc
60, Mirabelle
Ste-Agathe-des-Monts, Québec
J8C 0W9
simon at sleclerc.ca




> On Sep 17, 2023, at 22:57, Robert Patterson <robert at robertgpatterson.com> wrote:
> 
> Hello List,
> 
> I have just discovered that GetAdvanceWidthPoints is misnamed. The unit is actually being returned is a platform-dependent value that may be the pixel width. (On macOS it is actually points, but on Windows it is something else wildly other than points.)
> 
> To get actual 72 dpi points, you need to divide GetAdvanceWidthEVPUs by 4. This will give the correct value on both platforms. My question for this group is how to mitigate/address this bug.
> At a minimum, I could add a warning in the docs.
> I could rename the function to match what it returns.
> I could modify the function to actually return 72 dpi points.
> What is the wisest approach?
> 
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20230918/8d5d3a6e/attachment.htm>


More information about the JWLua mailing list