Repository: servo/core-foundation-rs (language: rust)

Issue:
core-graphics: non-public API usage _CGContextSetFontSmoothingStyle
I'm trying to submit an iOS app but Apple is rejecting it:
```
ITMS-90338: Non-public API usage - The app references non-public symbols in <appName>: _CGContextSetFontSmoothingStyle. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/
```

Even though my dependencies do not use the `set_font_smoothing_style` API, seems like Rust cannot strip it.

Similar to #656

I thought about deleting the API similar to  #700 but seems like at least alacritty uses it. Maybe it makes sense to use a feature flag instead?


Discussion / hints:
Are you sure that alacrity is using it and if so, through core_graphics?
oh nvm they have their own bindings it seems https://github.com/search?q=set_font_smoothing_style&type=code
I guess we could follow that other PR and remove the API instead..
And those are old forks… pretty sure the code is gone from current alacritty.
> I guess we could follow that other PR and remove the API instead..

I think I prefer this. If someone needs it, they can do a local binding… and GitHub search doesn’t seem to turn up users.

Fix patch:
diff --git a/core-graphics/src/context.rs b/core-graphics/src/context.rs
index 19e61915..a2fe326e 100644
--- a/core-graphics/src/context.rs
+++ b/core-graphics/src/context.rs
@@ -14,7 +14,7 @@ use crate::font::{CGFont, CGGlyph};
 use crate::geometry::{CGPoint, CGSize};
 use crate::gradient::{CGGradient, CGGradientDrawingOptions};
 use crate::path::CGPathRef;
-use core::ffi::{c_int, c_void};
+use core::ffi::c_void;
 use core_foundation::base::{CFTypeID, TCFType};
 
 use crate::geometry::{CGAffineTransform, CGRect};
@@ -223,12 +223,6 @@ impl CGContextRef {
         unsafe { CGContextSetAllowsFontSmoothing(self.as_ptr(), allows_font_smoothing) }
     }
 
-    pub fn set_font_smoothing_style(&self, style: i32) {
-        unsafe {
-            CGContextSetFontSmoothingStyle(self.as_ptr(), style as _);
-        }
-    }
-
     pub fn set_should_smooth_fonts(&self, should_smooth_fonts: bool) {
         unsafe { CGContextSetShouldSmoothFonts(self.as_ptr(), should_smooth_fonts) }
     }
@@ -639,7 +633,6 @@ extern "C" {
     fn CGContextSetBlendMode(c: crate::sys::CGContextRef, blendMode: CGBlendMode);
     fn CGContextSetAllowsFontSmoothing(c: crate::sys::CGContextRef, allowsFontSmoothing: bool);
     fn CGContextSetShouldSmoothFonts(c: crate::sys::CGContextRef, shouldSmoothFonts: bool);
-    fn CGContextSetFontSmoothingStyle(c: crate::sys::CGContextRef, style: c_int);
     fn CGContextSetAllowsAntialiasing(c: crate::sys::CGContextRef, allowsAntialiasing: bool);
     fn CGContextSetShouldAntialias(c: crate::sys::CGContextRef, shouldAntialias: bool);
     fn CGContextSetAllowsFontSubpixelQuantization(


Test patch: