This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 简体中文 zh-Hans | |
| English en | |
| 繁体中文 zh-Hant | |
| 繁体中文香港 zh-HK | |
| 日本语 ja | |
| 韩国 ko | |
| <CTFontDescriptor: 0x7fbeca6404e0>{attributes = <CFBasicHash 0x7fbecc9c7af0 [0x107bc6eb0]>{type = mutable dict, count = 8, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <CoreText/CTFont.h> | |
| #include <CoreText/CTFontCollection.h> | |
| #include <CoreFoundation/CFString.h> | |
| #include <CoreFoundation/CFBase.h> | |
| void callBack(const void *value, void *context) { | |
| CTFontDescriptorRef pDesc = static_cast<CTFontDescriptorRef>(value); | |
| CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute(pDesc, kCTFontFamilyNameAttribute); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Optional(Xingkai SC) | |
| Optional(STXingkai-SC-Bold) | |
| Optional(Xingkai SC) | |
| Optional(STXingkai-SC-Light) | |
| Optional(Wawati SC) | |
| Optional(DFWaWaSC-W5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CIAccordionFoldTransition | |
| CIAdditionCompositing | |
| CIAffineClamp | |
| CIAffineTile | |
| CIAffineTransform | |
| CIAreaHistogram | |
| CIAztecCodeGenerator | |
| CIBarsSwipeTransition | |
| CIBlendWithAlphaMask | |
| CIBlendWithMask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let options = unsafeBitCast(NSStringDrawingOptions.UsesLineFragmentOrigin.rawValue | NSStringDrawingOptions.UsesFontLeading.rawValue, | |
| NSStringDrawingOptions.self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIGraphicsBeginImageContext(self.view.bounds.size); | |
| [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| CGRect rect = CGRectMake(250,61 ,410, 255); | |
| CGImageRef imageRef = CGImageCreateWithImageInRect([viewImage CGImage], rect); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (UIImage *) imageWithView:(UIView *)view | |
| { | |
| UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0f); | |
| [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; | |
| UIImage * snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return snapshotImage; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (UIImage*)imageWithImage:(UIImage*)image | |
| scaledToSize:(CGSize)newSize; | |
| { | |
| UIGraphicsBeginImageContext( newSize ); | |
| [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; | |
| UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return newImage; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIView* captureView = self.view; | |
| /* Capture the screen shoot at native resolution */ | |
| UIGraphicsBeginImageContextWithOptions(captureView.bounds.size, captureView.opaque, 0.0); | |
| [captureView.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
| UIImage * screenshot = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| /* Render the screen shot at custom resolution */ | |
| CGRect cropRect = CGRectMake(0 ,0 ,1435 ,1435); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (UIImage *)captureView { | |
| float imageScale = sqrtf(powf(faceImageView.transform.a, 2.f) + powf(faceImageView.transform.c, 2.f)); | |
| CGFloat widthScale = faceImageView.bounds.size.width / faceImageView.image.size.width; | |
| CGFloat heightScale = faceImageView.bounds.size.height / faceImageView.image.size.height; | |
| float contentScale = MIN(widthScale, heightScale); | |
| float effectiveScale = imageScale * contentScale; | |
| CGSize captureSize = CGSizeMake(enclosingView.bounds.size.width / effectiveScale, enclosingView.bounds.size.height / effectiveScale); |
NewerOlder