CGContextSetShadowWithColor's documentation needs an accurate definition of "blur"

Originator:bobertjmurphy
Number:rdar://26127308 Date Originated:05-May-2016
Status:Open Resolved:
Product:Documentation Product Version:
Classification: Reproducible:Always
 
Summary:
My project requires that when creating a drop shadow for text, the Gaussian blur radius of the drop shadow needs to scale proportionally to the font size. For instance, if I had 24 point text with a Gaussian blur radius of 1, then for comparable 48 point text, the Gaussian blur radius would need to be 2.

CGContextSetShadowWithColor appears to be an ideal way to create drop shadows for text. Unfortuantely, its documentation does not make it clear how to obtain a particular blur radius in pixels.

I've only found two places in Apple's documentation which discuss this function's "blur" parameter.
1. The CGContext Reference, on the web and in Xcode, define it as "A non-negative number specifying the amount of blur."
2. https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadows/dq_shadows.html describes it as "A blur value, which specifies whether the image has a hard edge", and later remarks that a "blur value of 5... indicates a soft shadow edge"

If this value does indeed represent the Gaussian blur radius in pixels, it would be helpful if Apple would state that plainly. And if this value represents something else, it would be helpful if Apple would state what it *does* represent, and a means of mathematically converting between that value and the Gaussian blur radius in pixels, which seems to be the most common way of stating blur values.

Steps to Reproduce:


Expected Results:
CGContextSetShadowWithColor's blur parameter is accurately described in technical terms, and if necessary, has an explanation or reference to the mathematical equation(s) needed to convert back and forth between it and a standard Gaussian blur radius value in pixels.

Actual Results:
CGContextSetShadowWithColor's blur parameter is described in vague, non-technical language, and does not explain how to set the value to achieve a predictable, numerically accurate result.

Version:
1. CGContext Reference: https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CGContext/#//apple_ref/c/func/CGContextSetShadowWithColor
2. Quartz 2D Programming Guide: https://developer.apple.com/library/mac/docum

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!