Core Text

RSS for tag

Create text layouts, optimize font handling, and access font metrics and glyph data using Core Text.

Posts under Core Text tag

23 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

iOS 18 beta1/2 CoreText Crash
0 libobjc.A.dylib 0x000000018e27f008 objc_msgSend + 8 (:-1) 1 CoreFoundation 0x0000000190eaa4bc -[__NSDictionaryM objectForKey:] + 168 (NSDictionaryM.m:179) 2 CoreFoundation 0x0000000190f003e8 -[NSDictionary containsKey:] + 56 (NSDictionary.m:80) 3 CoreFoundation 0x0000000190f0006c CFDictionaryContainsKey + 52 (CFDictionary.c:265) 4 libGSFont.dylib 0x00000001af98cc14 GSFontIsOverriddenSystemFontName + 32 (GSFont.m:2860) 5 CoreText 0x0000000192d6f1fc CopyAttributeForSystemFont(__CFString const*, __CFString const*) + 64 (MetadataSupport.cpp:194) 6 CoreText 0x0000000192d6edd4 AddVariationInfo(TCFMutableDictionary&, __CFString const*) + 60 (SplicedFontSupport.cpp:6760) 7 CoreText 0x0000000192de1ea0 MakeSpliceDescriptor(__CFString const*, unsigned long, __CFString const*, __CFString const*, __CFNumber const*, __CFNumber const*, unsigned int, CTFontTextStylePlatform, unsigned int, __CFNumber co... + 4504 (SplicedFontSupport.cpp:7429) 8 CoreText 0x0000000192ddd374 TDescriptorSource::CopySpliceFontForName(__CFString const*, __CFString const*, __CFNumber const*, __CFNumber const*, CTFontLegibilityWeight, __CFBoolean const*, __CFNumber const*, __CFString const*... + 1376 (TDescriptorSource.cpp:4288) 9 CoreText 0x0000000192dda800 TDescriptorSource::CopySplicedDescriptorForName(__CFString const*, __CFString const*, __CFString const*, __CFNumber const*, __CFNumber const*, CTFontLegibilityWeight, __CFBoolean const*, __CFNumber... + 172 (TDescriptorSource.cpp:4322) 10 CoreText 0x0000000192d0a214 TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*, unsigned long) const + 2332 (TDescriptor.cpp:804) 11 CoreText 0x0000000192d09148 TDescriptor::InitBaseFont(unsigned long, double) + 76 (TDescriptor.cpp:952) https://feedbackassistant.apple.com/feedback/14091158
1
1
121
5d
PingFang.ttc font file is missing in iOS 18.0
I'm an iOS developer, and I've been testing our app in iOS 18.0 Beta. I noticed that there's a problem with the font rendering, and after troubleshooting, I've found out that it's caused by the removal of the PingFang.ttc font in 18.0. I would like to ask the reason for removing this font file and which font should be used to display Chinese in the future? My test device is an iPhone 11 Pro and the system version is iOS 18.0 (22A5297). I have also tested Beta 1 and it has the same issue. In previous versions of the system, the PingFang font is located in this directory /System/Library/Fonts/LanguageSupport/PingFang.ttc. But in iOS 18.0, the font file in this directory has become Kohinoor.ttc, and I've tested that this font can't display Chinese either. I traversed the following system font directories and could not find the PingFang.ttc font file. /System/Library/Fonts/AppFonts /System/Library/Fonts/Core /System/Library/Fonts/CoreAddition /System/Library/Fonts/CoreUI /System/Library/Fonts/LanguageSupport /System/Library/Fonts/UnicodeSupport /System/Library/Fonts/Watch Looking for answers, thanks for the help!
1
0
152
3d
TextKit2 to PDF WITHOUT Font embedding
I can render text from TextKit2 into a PDF everything is fine. But in this case the font is embedded into the PDF. I need the Pdf to contains only the paths / glyphs and not font. I can't find a solution yet. I don't want to create an image or using UIViews etc. It would be nice to get the bezier path of the text I have done this with TextKit1 but the glyphs are gone with TextKit2 Can anyone help me ? Thanks :)
0
0
112
1w
Unable to install font system-wide
Hi, I am planning to bring my fonts to iOS. However, it can only works on app but not system-wide. I did watch the WWDC video but have no idea how it works (no sample code/project). Sample Code: let fontURLs = [Bundle.main.url(forResource: "File", withExtension: "otf")!] as CFArray CTFontManagerRegisterFontURLs(fontURLs, .none, true) { ... Thank you.
3
0
293
3w
CoreText : CTFrame returns unexpected number of CTLine, and one CTLine contains several "\n"
Before iOS 17, CTFrameGetLines(ctFrame) returns exact number of lines it will displayed on the screen. However after iOS 17.2.x, under some unknown condition, it returns less CTLines. It's easy to reproduce: let formattedString = NSMutableAttributedString() formattedString.append(.init(string: "你", attributes: [.font: UIFont.boldSystemFont(ofSize: 14)])) formattedString.append(.init(string: "\n\n\n\n\n\n好\n")) let ctSetter = CTFramesetterCreateWithAttributedString(formattedString as CFAttributedString) let rect = CGRect(x: 0, y: 0, width: 100, height: 1000) let bezierPath = UIBezierPath(rect: rect) let ctFrame = CTFramesetterCreateFrame(ctSetter, CFRangeMake(0, formattedString.length), bezierPath.cgPath, nil) let ctLines = CTFrameGetLines(ctFrame) print("CTLine count: \(CFArrayGetCount(ctLines))") The test code above should print CTLine count: 7, but actually it returns 4. One weird CTLine is like: - 1 : <CTLine: 0x3031e0780>{run count = 1, string range = (2, 3), width = 0, A/D/L = 9.24023/2.75977/0, glyph count = 3, runs = ( <CTRun: 0x10173ec50>{string range = (2, 3), string = "\n\n\n", attributes = { NSFont = "<UICTFont: 0x101728800> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; }} ) } never met this issue before, is it a bug or just new feature...
0
0
194
May ’24
Custom Fonts were displayed as Helvetica and cannot be used from iOS 17
The app downloads assets consisting of custom fonts using tags from On-Demand Resources, registers them in the system font, and provides them to other apps such as Freeform through UIFontPickerViewController. Custom Fonts that were applied well until iOS 16 appear as Helvetica starting from iOS 17 and cannot be used. As the font list appears in the device's Settings > General > Font, the font downloaded from On-Demand Resources is registered in the system font. It has been confirmed to occur particularly frequently starting from iPhone 15 and iOS 17 and above. The app requests download from On-Demand Resources with NSBundleResourceRequest along with tags, receives assets in response with conditionally beginAccessingResources and beginAccessingResources, and then registers them in the system using CTFontManagerRegisterFontURLs.
0
0
242
May ’24
Emoji glyph bounding box incorrect in transformed CGContext.
I need to draw an outline of an Emoji glyph bounding box that is drawn in CGContext (macOS 14.4.1). I use NSLayoutManager - (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin; and I can get an emoji glyph bounding box using CoreText CGRect CTFontGetBoundingRectsForGlyphs(CTFontRef font, CTFontOrientation orientation, const CGGlyph *glyphs, CGRect *boundingRects, CFIndex count);. The bounding box is correct until the CGContext to which I draw the string with Emoji is not scaled or rotated. In such a case, an Emoji drawn in context is "sometimes" scaled, so its bounding box is not equal to the bounding box obtained from CoreText. Unfortunately, I can't figure out what the dependencies between glyph size, CGContext rotation, and scale are. I couldn't find any linearity between these variables. For example, an Emoji is drawn correctly at scale 6, rotation 0, when CGContext is rotated by 1 degree, Emoji is downsized by 1 pixel, then back in nominal size when rotation is between 2 and 4 degrees, then downsized for 5 degrees, nominal at 6, etc. Has anyone solved this?
0
0
287
May ’24
Umlauts broken in Sonoma 14.4?
When running my app from Xcode Umlauts are all of a sudden broken in several places. The app has been out in the public w/o similar issues for years. For example, this is the result when entering a filename in my NSDocument-based app: So far I could only observe the bug when launching under Sonoma from Xcode but I'm worried this might be a general issue for users of the app running the release build. Any ideas about what happened in macOS 14.4..? Cheers, Jay
4
0
458
4w
UITextView Mac Catalyst Selected Text Replacement Bug
Starting with the macOS version 14.x.x and TextKit1, selecting multiple lines of text triggers a text replacement bug: some of the text on one of the selected lines inadvertently replaces a portion of the selected text. For example, the bug is exhibited when selecting the following lines: Carnaroli, Maratelli, or Vialone Nano are best Vialone Nano cooks quickly – watch it! It also absorbs condiments nicely. Avoid Baldo, Originario, Ribe and Roma To trigger the bug, select the three line paragraph using either the cursor or shift with arrow keys. Notice that a portion of the selected text was replaced. Command-Z to undo will allow you to repeat the undesired behavior. In this case, "e Nano cooks quickly - " is replaced by "Baldo, Originario, Ribe." This does not occur with all strings or selected strings, but in cases where it does occur, it is perfectly reproducible. It does not occur on iOS. Pasteboard contents are irrelevant. After triggering the bug repeatedly, at some point it stops occurring. Why does this bug occur? How can it be fixed? Here is some sample code to reproduce the issue. @end @implementation TestNoteViewController - (void)viewDidLoad { [super viewDidLoad]; [self createTextView]; } - (void)createTextView { NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.note.text attributes:nil]; NSTextStorage *textStorage = [NSTextStorage new]; [textStorage appendAttributedString:attrString]; CGRect newTextViewRect = self.view.bounds; // Create the layout manager NSLayoutManager *layoutManager = [NSLayoutManager new]; [textStorage addLayoutManager:layoutManager]; // Create a text container NSTextContainer *container = [[NSTextContainer alloc] initWithSize:CGSizeMake(newTextViewRect.size.width, CGFLOAT_MAX)]; [layoutManager addTextContainer:container]; // Create and place a text view UITextView *textView = [[UITextView alloc] initWithFrame:newTextViewRect textContainer:container]; [self.view addSubview:textView]; textView.translatesAutoresizingMaskIntoConstraints = NO; UILayoutGuide *safeArea = textView.superview.safeAreaLayoutGuide; [textView.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor].active = YES; [textView.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor].active = YES; [textView.topAnchor constraintEqualToAnchor:safeArea.topAnchor].active = YES; [textView.bottomAnchor constraintEqualToAnchor:textView.superview.bottomAnchor].active = YES; } @end
0
1
350
Apr ’24
iPhone font issue.
Hello, First time poster. Was wondering if someone might know the answer to this. So I wanted to use a fancy font in my iPhone app for a title. The following code works fine, but the font I really want is “Apple Chancery” but it will not show up on the iPhone, even though this font is default on all Mac books. Any ideas why that font will not work? Thanks… Text("(whiskyname)") .frame(width: 350, height:56) .background(Color.blue.opacity(0.3)).border(Color.black, width: 3) .cornerRadius(5) .font(.custom("Snell Roundhand", fixedSize: 45)) .foregroundColor(.black) .bold()
2
0
373
Feb ’24
System fonts file access: allowed for sandboxed apps?
Hello! I am developing an ebook reader iOS app that uses c/c++ codec as a page renderer. The codec uses TrueType as a font rendering engine that requires access to .ttf (or .ttc) files. Currently, I supply TrueType with fonts embedded in the app package, so they lay within the app sandbox. The codec supports the whole unicode plane and many languages that ebooks may use, but the fonts I supply don't have some of the important glyphs (i.e. katakana or hangul). I see that iOS has its own font storage, located in /System/Library/Fonts/ directory. The codec is able to parse this directory and read .ttf files located inside, using these fonts as a fallback in the case when the supplied fonts can't draw certain glyphs. I use opendir and fopen(in "rb" mode) as a way to read the data, and it works well. Does this type of access to the system directory violate the sandbox rule for an app distribution, and, if yes, is there a way to get access to stored .ttf files not violating the mentioned rule?
0
0
400
Jan ’24
UITextView giving wrong UITextPosition with closestPosition on iOS 17 with custom arabic font
Hi, I have used some custom Arabic fonts in UITextView to render some Arabic fonts. On iOS 17 the following code is not giving me the correct position of the tapped text in some special cases. Following the code i am using with the TapGestureRecognizer. @objc func arabicTextViewTapped(_ sender: UITapGestureRecognizer) { let attributedString = NSMutableAttributedString(attributedString: arabicTextView.attributedText) attributedString.removeAttribute(.backgroundColor, range: NSRange(location: 0, length: attributedString.length)) let touchPosition = sender.location(in: sender.view) guard let textPosition = arabicTextView.closestPosition(to: touchPosition), let textRange = arabicTextView.tokenizer .rangeEnclosingPosition(textPosition, with: .word, inDirection: .init(rawValue: 1)) else { return } guard let text = arabicTextView.text(in: textRange) else { return } } In the image below if there is some special character (called Ramos e aukaf) as the first character (which in this case is the small first character on the second line) then this code gives the position on the first line. guard let textPosition = arabicTextView.closestPosition(to: touchPosition) In the below case, the above code works perfectly fine as small character is not the first character on the second line. Also this is only happening on ios 17. Any help is highly appriciated.
0
0
489
Jan ’24
Fonts randomly stop rendering correctly on iOS 17/Xcode 15
Hello After updating my/our devices to iOS 17 (or XCode 15, not entirely sure), the custom fonts in our application have started randomly not working. Usually it will happen after the app has been in the background for a while. What happens is that: The fonts either don't load at all. For icon fonts, this means a lot of question marks. The fonts get swapped around, meaning regular text (Roboto, custom font) starts rendering using the icon font (Font Awesome). I can tell because I recognize the font from development. I have no idea how to reproduce it. I tried simulating the memory warning on the simulator, but that doesn't trigger it. It did not happen when building for iOS 16 and I did not change any font logic since then. It still does not happen on devices running iOS 17 but on versions of the app built with XCode 14. Some debug info: XCode: 15.0.1 (15A507) iOS: 17.1.1 (real device, I have not observed it on Simulator) We load the custom fonts from a proprietary SPM package: fileprivate static func registerFont(fontName: String, ext: String = "otf") { guard let fontURL = Bundle.module.url(forResource: fontName, withExtension: ext), let fontDataProvider = CGDataProvider(url: fontURL as CFURL), let font = CGFont(fontDataProvider) else { fatalError("Couldn't create font from filename: \(fontName).\(ext)") } var error: Unmanaged<CFError>? CTFontManagerRegisterGraphicsFont(font, &error) } public static func registerFonts() { registerFont(fontName: "Font Awesome 6 Brands-Regular-400") registerFont(fontName: "Font Awesome 6 Duotone-Solid-900") registerFont(fontName: "Font Awesome 6 Pro-Light-300") registerFont(fontName: "Font Awesome 6 Pro-Regular-400") registerFont(fontName: "Font Awesome 6 Pro-Solid-900") registerFont(fontName: "Font Awesome 6 Pro-Thin-100") registerFont(fontName: "Font Awesome 6 Sharp-Light-300") registerFont(fontName: "Font Awesome 6 Sharp-Regular-400") registerFont(fontName: "Font Awesome 6 Sharp-Solid-900") registerFont(fontName: "Roboto-Medium", ext: "ttf") registerFont(fontName: "Roboto-Regular", ext: "ttf") registerFont(fontName: "RobotoMono-Regular", ext: "ttf") } // Similar methods for all font types and icons: @objc public static func getDefaultFont(size: CGFloat) -> UIFont { return UIFont.init(name: "Roboto-Regular", size: size) ?? UIFont.systemFont(ofSize: size); } This code is the called in didFinishLaunching, and it would crash the app if it failed: FontHandler.registerFonts() To reiterate, all the fonts work when launching the app. Restarting the app always fixes it, which, combined with the fact that they get swapped around, leads me to believe that it's some kind of font caching issue. We use the fonts in code-only (no storyboards or xibs ever). A font would be loaded like this: let label = UILabel() label.font = FontHandler.getDefaultFont(size: 15) The font files ship with the SPM package itself, which contains the FontHandler class used above. import PackageDescription let package = Package( name: "MyPackageName", defaultLocalization: "en", platforms: [ .iOS(.v11) ], products: [ .library( name: "MyPackageName", targets: ["MyPackageName"]), ], targets: [ .target( name: "MyPackageName", resources: [ .process("Fonts") ]), .testTarget( name: "MyPackageNameTests", dependencies: ["MyPackageName"]), ] )
10
3
2.2k
May ’24
Why fonts loaded using CoreText (CTFont) behave different than loaded using AppKit (NSFont)?
I tried to load font using CTFontCreateWithFontDescriptor() and it behaves differently than loaded using NSFont(). Let's say the goal is to load font using CoreText that is exactly the same as using AppKit. NSTextField If I use them in NSTextField text offsets and rendering do not match. let familyName = "Helvetica" let fontSize: CGFloat = 30 let string = "Hello, World! gÖ,|#" // Load font using AppKit let font1 = NSFont(name: familyName, size: fontSize)! // Load font using CoreText API let font2 = CTFontCreateWithFontDescriptor(CTFontDescriptorCreateWithAttributes([ kCTFontFamilyNameAttribute: familyName, kCTFontSizeAttribute: fontSize, ] as [CFString : Any] as CFDictionary), 0, nil) as NSFont // Setup text fields let field1 = NSTextField() let field2 = NSTextField() field1.setAsLabel() field2.setAsLabel() field1.font = font1 field2.font = font2 field1.stringValue = string field2.stringValue = string NSAttributedString If I use them in NSAttributedString bounding box height of text is different: let bounds1 = NSAttributedString(string: string, attributes: [ .font: font1 ]).boundingRect(with: .infinity) let bounds2 = NSAttributedString(string: string, attributes: [ .font: font2 ]).boundingRect(with: .infinity) print(bounds1) // Prints: (0.0, -7.0, 252.3486328125, 37.0) print(bounds2) // Prints: (0.0, -7.0, 252.3486328125, 31.0) Investigation I compared fonts, font attributes, traits, feature settings, even binary font tables but I didn't find any difference. It seems like there is something inside that alters behaviour. I found that if I add .usesDeviceMetrics option to NSAttributedString bounds getter, it returns the same result but also completely different frame. let bounds1 = NSAttributedString(string: "Hello, World! gÖ,|#", attributes: [.font: font1]).boundingRect(with: .infinity, options: [.usesDeviceMetrics]) let bounds2 = NSAttributedString(string: "Hello, World! gÖ,|#", attributes: [.font: font2]).boundingRect(with: .infinity, options: [.usesDeviceMetrics]) print(bounds1) // Prints: (2.3583984375, -6.6357421875, 249.9609375, 33.837890625) print(bounds2) // Prints: (2.3583984375, -6.6357421875, 249.9609375, 33.837890625) Question How to load a font using CoreText in a way that NSFont does? Minor question: Why does NSTextField set it's frame origin to -2.0? Just extensions I used in code above: extension CGSize { public static var infinity: Self { .init(width: CGFloat.infinity, height: CGFloat.infinity) } } extension NSTextField { func setAsLabel() { translatesAutoresizingMaskIntoConstraints = false isBezeled = false isBordered = false isEditable = false isSelectable = false drawsBackground = false } }
2
0
519
Nov ’23
Font custom in my App
Hi guys, I have imported font (I have added in info.plist) and I use this code to import in all of project: struct swim_targetApp: App { var body: some Scene { WindowGroup { ContentView() .environment(\.font, Font.custom("SFCompactRounded-Regular", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Ultralight", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Thin", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Light", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Medium", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Semibold", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Bold", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Heavy", size: 16)) .environment(\.font, Font.custom("SFCompactRounded-Black", size: 16)) } } } But .title, .title3, navigationBarTitle don't use my custom font (ex 1, 2 in screenshot), but in another parts working fine (ex 3 in screenshot). Can you help me? Thank you ;)
0
0
470
Oct ’23
Why was NSAttributedString.Key.verticalGlyphForm Deprecated in macOS 14, and How to Handle Vertical Text Now?
In macOS 14, NSAttributedString.Key.verticalGlyphForm has been deprecated. This key was previously used for rendering text vertically, particularly in languages like Chinese, Japanese, and Korean. I'm curious about the reasons behind its deprecation and would appreciate insights into alternative methods for displaying vertical text.
1
0
494
Oct ’23
Punctuation missing from system font when Chinese language is selected
Dear experts, I get glyphs from the system font using CTFontGetGlyphsForCharacters, something like this: UIFont* uifont = [UIFont monospacedDigitSystemFontOfSize: s weight: w]; CTFontRef font = (__bridge CTFontRef)uifont; CTFontGetGlyphsForCharacters(font, ....); The characters that I ask for are basically latin-1 plus a few others. The app is not localised for Chinese. When I change the phone's default language to Chinese, this code gets glyphs for most characters OK but it fails for a few punctuation symbols: 91 = [ 93 = ] 183 = middle dot 8220 = left double curly quote 8221 = right double curly quote Can anyone guess what's going on here? What's special about those characters? Thanks, Phil.
0
0
543
Sep ’23
iOS 17:CTFramesetterSuggestFrameSizeWithConstraints does not provide the correct text size.
In iOS 17, when I try to use CTFramesetterSuggestFrameSizeWithConstraints to obtain the size of a text, if the system-provided bold font is used, the resulting rectangular area may not be sufficient to accommodate the text. The provided example code is not allowing me to display the complete text within the CTFrame. code: NSString *testString = @"《测试》"; CFStringRef cfTestString = CFStringCreateWithCString(kCFAllocatorDefault, [testString cStringUsingEncoding:NSUTF8StringEncoding], kCFStringEncodingUTF8); UIFont *uiFont = [UIFont boldSystemFontOfSize:50.0]; UIFontDescriptor *fontDescriptor = uiFont.fontDescriptor; CTFontDescriptorRef ctFontDescriptor = (__bridge CTFontDescriptorRef)fontDescriptor; CTFontRef ct_font = CTFontCreateWithFontDescriptor(ctFontDescriptor, uiFont.pointSize, NULL); CGFloat color_components[4] = {1.0, 1.0, 1.0, 1.0}; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGColorRef cgColor = CGColorCreate(colorSpace, color_components); CTParagraphStyleSetting styleSetting; styleSetting.spec = kCTParagraphStyleSpecifierAlignment; CTTextAlignment ctAlignment = kCTTextAlignmentCenter; styleSetting.value = &ctAlignment; styleSetting.valueSize = sizeof(kCTTextAlignmentCenter); CTParagraphStyleRef ctParagraphStyle = CTParagraphStyleCreate(&styleSetting, 1); const void* keys[] = {kCTFontAttributeName, kCTForegroundColorAttributeName, kCTParagraphStyleAttributeName}; const void* values[] = {ct_font, cgColor, ctParagraphStyle}; CFDictionaryRef attr = CFDictionaryCreate(kCFAllocatorDefault, keys, values, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFAttributedStringRef cfAttributedString = CFAttributedStringCreate(kCFAllocatorDefault, cfTestString, attr); CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(cfAttributedString); CGSize constraints = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX); CGSize stringSize = CTFramesetterSuggestFrameSizeWithConstraints(framesetter, CFRangeMake(0, 0), NULL, constraints, NULL); float width = ceil(stringSize.width); float height = ceil(stringSize.height); CGPathRef path = CGPathCreateWithRect(CGRectMake(0.0, 0.0, width, height), NULL); CTFrameRef cfFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL); CFRange stringRange = CTFrameGetStringRange(cfFrame); CFRange visibleStringRange = CTFrameGetVisibleStringRange(cfFrame); NSLog(@"stringRange.location: %@ stringRange.length: %@", @(stringRange.location), @(stringRange.length)); NSLog(@"visibleStringRange.location: %@ visibleStringRange.length: %@", @(visibleStringRange.location), @(visibleStringRange.length)); log: stringRange.location: 0 stringRange.length: 4 visibleStringRange.location: 0 visibleStringRange.length: 2
2
0
774
Oct ’23