Core Text

RSS for tag

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

Core Text Documentation

Posts under Core Text tag

39 results found
Sort by:
Post not yet marked as solved
1.2k Views

Using San Francisco in a Unity app

Hi everyone,For a while now, I've been working on an augmented-reality app in the Unity game engine, and recently I was hoping to try to get it to look more native to iOS. One major step in this process is using the native system font, San Francisco (at the moment, I'm using Roboto, which looks nice but out-of-place on iOS). However, I'm unable to find a way for the Unity game engine to get the system font from the operating system, so I think I will need to download San Francisco and put it in Unity manually. Is there a way I can go about doing this while remaining completely within Apple's guidelines?Thanks!
Asked
by Meorge.
Last updated
.
Post not yet marked as solved
200 Views

Cannot obtain third-party custom fonts correctly

Preconditions: The certificate has been opened to obtain third-party fonts 2, Use Installed Fonts is checked in Capabilities Problem scenario: In iOS/iPadOS 13 or later, after successfully installing custom fonts through third-party apps. Open your own APP through [UIFont familyNames] or CTFontManagerCopyAvailablePostScriptNames() Corresponding font data is not obtained. difference: The above questions can be correctly obtained in the following scenarios In the native software Apple Pages, it can be obtained normally In the same APP, get the font by using UIFontPickerViewController and select it for use. After that, you can get it through [UIFont familyNames] or CTFontManagerCopyAvailablePostScriptNames() normally, and the overwrite installation is also normal (the uninstall installation is gone).
Asked Last updated
.
Post not yet marked as solved
286 Views

How do I add downloadable fonts to iOS 14?

Hello, according to this document - https://developer.apple.com/fonts/system-fonts/#downloadable the YuKyokasho Japanese font should be available for download on iOS 13+ devices but I'm unable to find how to use it on a SwiftUI app. I have the font installed on my Mac through Font Book but I'm not sure if I can just copy it to my app's resources folder and use it as a custom font, because I may be breaking some obscure licensing terms. Could somebody give me any hint on which is the proper way of doing this or point me to documentation? Thanks!
Asked
by widemos.
Last updated
.
Post not yet marked as solved
161 Views

Drawing Text At an Angle

Hello All: I am having an issue of drawing some text at an angle where the text is on a surface where the surface is angled to the back. (Here comes some waving hands - I can't find a way to attach an image). So if the object is a simple cube, the side that is facing you is not straight (at 90°), it's at 120° - leaning to the back. I can draw text using core text at any sort of rotation about a single point, but I can't figure out if it's the transform or the rotation I have to 'fiddle with' to draw the text like I want it. So, is CoreText the correct library to use? If not is there an appropriate system library to use. If CoreText is the correct system library, a hint on how to setup CoreText for this would be appreciated. Stay Safe John
Asked Last updated
.
Post not yet marked as solved
136 Views

KCTKernAttributeName option not working in CTFrameGetLines

KCTKernAttributeName option not working in CTFrameGetLines I am trying to get a multiline of text from an NSMutableAttributedString via CTFrameGetLines. All other options are applied, but kCTKernAttributeName option is not reflected in CTFrameGetLines. Even if I put the value of kCTKernAttributeName in NSMutableAttributedString, it behaves as if there is no kCTKernAttributeName value. Is there any solution or cause?
Asked Last updated
.
Post not yet marked as solved
165 Views

Installing Jupyter notebook on Apple Mac with M1 CPU

I guess my first question is how to attach text (pdf's and picture to a post). It is not clear how to do it. Respectfully, Led_Zepplin
Asked Last updated
.
Post not yet marked as solved
1.7k Views

San Francisco Mono in ios app

Do you know if I can use San Francisco Mono font in my app?I can find the font in Xcode folder and it works fine, but I don't know if Apple allows to use it.
Asked
by pilnik.
Last updated
.
Post not yet marked as solved
3.7k Views

Using San Francisco in an app

I'm developing an app that allows users to select a font and type text overtop images, similar to Skitch and others. To allow users to change the font, I have an array of font names which I display in table view cells. I provide a font preview by simply using UIFont(name:size:) and providing the name, for example "Helvetica Neue." Now with iOS 9 I want to add support for using San Francisco. The problem is, initializing a UIFont with "San Francisco" returns nil. In fact, it doesn't look like San Francisco is even included when printing out all available fonts.I could check if the app is running on iOS 9 and if so just include "San Francisco" in the array and use UIFont.systemFontOfSize when San Francisco is selected, but this is a really poor and dirty solution. How can I do this more appropriately?
Asked
by Jordan.
Last updated
.
Post not yet marked as solved
251 Views

Variable fonts in iOS 14

The following code allows to create a font with different weights. func makeFont(weight: CGFloat, size: CGFloat) -> UIFont { 		var attributesDict = [String: Any]() 		attributesDict["Weight"] = weight 		/* Rubik-Light - is a variable font */ 		let fontDescriptor = UIFontDescriptor( 				fontAttributes: [ 						UIFontDescriptor.AttributeName.name : "Rubik-Light", 						kCTFontVariationAttribute as UIFontDescriptor.AttributeName : attributesDict 				] 		) 		return UIFont(descriptor: fontDescriptor, size: size) } It works fine on ios 13 and below, but doesn't work on iOS 14. Is there any solution?
Asked Last updated
.
Post not yet marked as solved
226 Views

Move the cursor to truncated character it's not displaying full text in UITextField

if the character reaches particular limit text will be truncated in UITextField, if we move the cursor to truncated(LineBreakMode) character it's not displaying full text, it's displaying like “…”, is any other option to display those truncated character in UITextfield
Asked
by SadeeshTT.
Last updated
.
Post not yet marked as solved
158 Views

Here's part of why syncing (Contacts, Calendar and Reminders etc.) is so unbelievably slow and CPU-intensive. (Suggestion/idea)

Here's part of why syncing (Contacts, Calendar and Reminders etc.) is so unbelievably slow and CPU-intensive. (Suggestion/ idea) AppleOSes are storing and communicating and comparing HEX values as STRINGS: They should be doing all that with the raw values. That would use half the space. 4 bits per hex digit instead of over 8. (0xF is 1111 in binary, of course) Proof of the error: https://discussions.apple.com/thread/8164982?answerId=32580805022#32580805022 varchars!! Just on one MacOS system, the Contacts and Calendar syncing agents have used many hours of CPU time since last reboot - so surely that's got to add up to an average of over a year of CPU Time over the life of each of Apple's over a billion active devices. And there's the environmental impact: If Apple switched to binary representations on all their current devices, I wonder how many tons of CO2 credit that would generate, per Apple's own accounting!? And impressive wins to announce at a future Apple Event! Those wasted resources could be not used, or used for error detection and correction to reduce data corruption. (Can't believe Apple failed to adopt ZFS and if I'm not mistaken, doesn't use ECC RAM (Error Checking and Correcting Random Access Memory) in any of its current hardware products, but that's a bit of a tangent.)
Asked
by MrElvey.
Last updated
.
Post not yet marked as solved
242 Views

Ruby Annotation in iOS

In iOS 8 Apple added in Core Text the Ruby Annotation, or the possibility to inject some character above the main text. This is very useful if you develop apps that shows Chinese or japanese text, writing that use this annotation. Up to iOS 10.3, is was simple use this feature: it was necessary only create an attributedText that was using the ruby annotation and pass the attributed text to the label and, that's it! in Apple way, (or very simple) you can show some text with ruby annotation with all the features of auto layout of UILabel. It was just missing the ability to put the text vertically and the UILabel was perfect. From iOS 11.0 this feature doesn't work! Why? "An Apple engineer had not documented the feature", Suggestion:"Create a label yourself that displays the Ruby annotation" (Apple's answer from Apple Bug Report). In internet there are some code to show ruby annotation but if the string is long the view or label doesn't become bigger an trunk the string. the scaling text, doesn't work. This is because you have to override the draw method and use Core Text to draw the text. I am trying over and over again to create a label that allows you to view text with the ruby annotation, but I have major difficulties: Core Text is no longer updated and many of the documentation pages are empty and without documentation. what little code there is is in objective C. There are no alternatives for displaying ruby-annotated text horizontally or vertically. TextKit doesn't talk about displaying text like that. My application is a Japanese language dictionary, so the ruby annotation is very important !!!! Is it possible that there isn't a definitive solution? is it possible that Apple can't add this feature because the engineer doesn't write the documentation to the feature that write? Is possible that an Engineer doesn't write documentation about a feature and for this reason the feature is removed ? Any Apple Engineer can help me to solve this problem? Thank you
Asked
by Rufy.
Last updated
.
Post not yet marked as solved
216 Views

Apps always reset to infinite text drag delay

Hello, I am not a developer but my Mac has such a serious problem I am desperate for help. After some time of being open, all text applications lose the ability to drag selected text. This may happen after a few hours or a few days. Relaunching the affected apps fixes it by setting drag delay to normal. This problem started some years ago in version High Sierra and I have been living with it since then. I had set a custom drag delay from earlier versions by saying defaults write -g NSDragAndDropTextDelay -int 100 This worked until High Sierra when the current trouble started. Now I am running the latest Mojave. The problem is obviously in my preferences files but which one and can I delete the offending setting with XCODE PLIST editor? Thanks for any help.
Asked Last updated
.
Post not yet marked as solved
810 Views

iOS 8 vs San Francisco Font

Hi everyone!We are working on an app that supports iOS8 to iOS10, and now our UI/UX team want to specify the app's font as San Francisco. But as you know, this font was introduced in iOS9, so my question is :Can we download San Francisco font from https://developer.apple.com/fonts/and put it in the app project to use it in all iOS versions?Do we need some approval from Apple?Thanks!
Asked Last updated
.
Post not yet marked as solved
97 Views

Tagging people

I am in a group chat where everyone else has updated and is able to "tag" others. We are all running 14.01 and I am the only one not able to tag anyone.
Asked
by MoeKeego.
Last updated
.