Hi,
I'm using one ttf font that simulate a bitmap look in my app. However, macOS renders all font with anti-aliasing. On those kind of font, that introduce some artefacts.
Is there a way to disable anti-aliasing or some tricks that would make like there were no anti-aliasing?
Thanks.
Typography
RSS for tagImplement good typography technique, make the most of the advanced features in Apple system fonts, and integrate custom fonts.
Posts under Typography tag
29 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello everyone, I am having an issue where the attributed text that I have in my UITextView is not scaling dynamically with phone text size, whenever I remove the attributed text logic, it scales fine, however, with it, it stays at a set font size.
struct AutoDetectedClickableDataView: UIViewRepresentable {
let text: String
@Binding var height: CGFloat
func makeUIView(context: Context) -> UITextView {
let textView = UITextView()
textView.dataDetectorTypes = [.phoneNumber, .address, .link]
textView.isEditable = false
textView.isScrollEnabled = false
textView.backgroundColor = .clear
textView.font = UIFont.preferredFont(forTextStyle: .body) /*UIFontMetrics(forTextStyle: .body).scaledFont(for: UIFont.systemFont(ofSize: 16.0)) */
textView.adjustsFontForContentSizeCategory = true
textView.textContainer.lineBreakMode = .byWordWrapping
textView.textContainerInset = .zero
textView.textContainer.lineFragmentPadding = 0
textView.translatesAutoresizingMaskIntoConstraints = false
textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
textView.setContentHuggingPriority(.defaultHigh, for: .horizontal)
return textView
}
func updateUIView(_ uiView: UITextView, context: Context) {
let attributed = NSMutableAttributedString(string: text, attributes: [
.font: UIFont.preferredFont(forTextStyle: .body)
])
let detector = try? NSDataDetector(types: NSTextCheckingResult.CheckingType.address.rawValue |
NSTextCheckingResult.CheckingType.link.rawValue |
NSTextCheckingResult.CheckingType.phoneNumber.rawValue)
detector?.enumerateMatches(in: text, options: [], range: NSRange(location: 0, length: text.utf16.count)) { match, _, _ in
guard let match = match else { return }
attributed.addAttributes([
.foregroundColor: UIColor.systemBlue,
.underlineStyle: NSUnderlineStyle.single.rawValue,
], range: match.range)
}
uiView.attributedText = attributed
// uiView.text = text
DispatchQueue.main.async {
uiView.layoutIfNeeded()
let fittingSize = CGSize(width: uiView.bounds.width, height: .greatestFiniteMagnitude)
let size = uiView.sizeThatFits(fittingSize)
height = size.height
}
}
}
Hi Support Team,
I am new here. I am unable to add my fonts to the asset catalog there is no option to add new font set when I click the plus sign.
When I drag my files in they show up as data.
I have a Contents.json in the font folder called BeVietnamProFont.font.
Is there something I am doing wrong?
Thanks SO much!
{
"info": { "version": 1, "author": "xcode" },
"properties": {},
"fonts": [
{ "filename": "BeVietnamPro-Black.ttf", "weight": "black", "style": "normal" },
{ "filename": "BeVietnamPro-BlackItalic.ttf", "weight": "black", "style": "italic" },
{ "filename": "BeVietnamPro-Bold.ttf", "weight": "bold", "style": "normal" },
{ "filename": "BeVietnamPro-BoldItalic.ttf", "weight": "bold", "style": "italic" },
{ "filename": "BeVietnamPro-ExtraBold.ttf", "weight": "heavy", "style": "normal" },
{ "filename": "BeVietnamPro-ExtraBoldItalic.ttf", "weight": "heavy", "style": "italic" },
{ "filename": "BeVietnamPro-ExtraLight.ttf", "weight": "ultralight", "style": "normal" },
{ "filename": "BeVietnamPro-ExtraLightItalic.ttf", "weight": "ultralight", "style": "italic" },
{ "filename": "BeVietnamPro-Light.ttf", "weight": "light", "style": "normal" },
{ "filename": "BeVietnamPro-LightItalic.ttf", "weight": "light", "style": "italic" },
{ "filename": "BeVietnamPro-Regular.ttf", "weight": "regular", "style": "normal" },
{ "filename": "BeVietnamPro-Italic.ttf", "weight": "regular", "style": "italic" },
{ "filename": "BeVietnamPro-Medium.ttf", "weight": "medium", "style": "normal" },
{ "filename": "BeVietnamPro-MediumItalic.ttf", "weight": "medium", "style": "italic" },
{ "filename": "BeVietnamPro-SemiBold.ttf", "weight": "semibold", "style": "normal" },
{ "filename": "BeVietnamPro-SemiBoldItalic.ttf", "weight": "semibold", "style": "italic" },
{ "filename": "BeVietnamPro-Thin.ttf", "weight": "thin", "style": "normal" },
{ "filename": "BeVietnamPro-ThinItalic.ttf", "weight": "thin", "style": "italic" }
]
}

Project structure is:
App target + widget extension + widget intent extension
All share a common appgroup group.com.x.y and all file handling is done using
FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.x.y")
so that only the shared container is used.
Using the Main app target, a font "Chewy-Regular.ttf" is downloaded and saved to the shared AppGroup container.
Font can now be loaded via
CTFontManagerRegisterFontsForURL
and displayed in a Main App Text view
Text("Testing...").font(Font.custom("Chewy-Regular", size: 20))
Now add a Widgetkit widget instance that uses this font.
In 'getTimeLine() and getSnapShot() of IntentTimelineProvider we load the font again via CTFontManagerRegisterFontsForURL (this needs to happen again probably because widget runs in a separate process from the main app?).
On simulator, the widget will show the correct font.
BUT
On iPhone7 real device, the widget will show the 'redacted placeholder view'. It seems that something is crashing.
I see in the device console :
error 14:39:07.567120-0800 chronod No configuration found for configured widget identifier: D9BF75EE-4A04-441A-8C85-1507F7ECE379
fault 14:39:07.625600-0800 widgetxExtension -[EXSwiftUI_Subsystem beginUsing:withBundle:] unexpectedly called multiple times.
error 14:39:07.672733-0800 chronod Encountered an error reading the view archive for <private>; error: <private>
error 14:39:07.672799-0800 chronod [co.appevolve.onewidget.widgetx:widgetx:small:1536744920620481560@148.0/148.0/20.2] reload: could not decode view
error 14:39:07.674984-0800 kernel Sandbox: chronod(2128) deny(1) file-read-metadata /private/var/mobile/Containers/Shared/AppGroup/9B524570-1765-4C24-9E0C-15BC3982F0DC/downloadedFonts/Chewy/Chewy-Regular.ttf
error 14:39:07.675762-0800 kernel Sandbox: chronod(2128) deny(1) file-read-data /private/var/mobile/Containers/Shared/AppGroup/9B524570-1765-4C24-9E0C-15BC3982F0DC/downloadedFonts/Chewy/Chewy-Regular.ttf
error 14:39:07.708914-0800 chronod [u 8D2C83B3-A6CB-432E-A9D4-9BC8F7056B10:m (null)] [<private>(<private>)] Connection to plugin invalidated while in use.
fault 14:39:07.710284-0800 widgetxExtension -[EXSwiftUI_Subsystem beginUsing:withBundle:] unexpectedly called multiple times.
error 14:39:07.803468-0800 chronod Encountered an error reading the view archive for <private>; error: <private>
It seems that it's a permission issue, and the textview can't access the font file it needs when the widget is rendering.
Notes:
1) Font is definitely registered because I can see them in
for fontFamily in UIFont.familyNames {
for fontName in UIFont.fontNames(forFamilyName: fontFamily) {
print(fontName)
								...
in both the Main App target and the Widget Extension target
2) If I make make the font part of the app bundle and add to 'Fonts provided by application' , the are loaded absolutely fine in the Main App and the Widget on simulator and iPhone 7 real device.
3) I do see this error sometimes in the Widget extension target log, don't know if it's related.
widgetxExtension[1385:254599] [User Defaults] Couldn't read values in CFPrefsPlistSource<0x28375b880> (Domain: group.co.appevolve.onewidget, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
4) I suspected something to do with app groups, so I tried to copy the font into the Widget Extension container and load from there, but had the same result.
Please help! Thank you.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
iOS
WidgetKit
Typography
SwiftUI
(EN):
After upgrading to macOS 15+, the system contains two incompatible versions of the PingFang (苹方) font:
1. A system-provided version (/System/Library/Fonts/PingFang.ttc)
2. A user-installed version via Font Book (located in ~/Library/Fonts or /Library/Fonts)
When a user installs or removes the PingFang font via Font Book after the app starts, font resolution may switch, causing garbled text in newly opened windows or views.
This issue did not occur in macOS 13 or 14, and seems specific to how macOS 15+ handles system and user font overlays.
Sto cercando di creare un PDF che, a seconda del sistema operativo, utilizzi un font diverso. Visto che mi è capitato di scaricare da Internet un PDF che veniva visualizzato con con Arial su Windows e con Helvetica su iOS/macOS (anche su siti di drive, OneDrive )
vorrei creare un PDF che venga visualizzato con Arial su Windows e con Helvetica su iOS/macOS, sfruttando i meccanismi di fallback dei font di sistema (senza incorporare i font nel PDF).
Ho provato a:
• Scrivere il documento in Arial da Word su Windows;
• Scrivere il documento in Helvetica da Word su Windows;
• Disattivare l’incorporamento dei font nel salvataggio PDF su “Word”;
Tuttavia, su iOS , in app come Onedrive, il PDF continua a visualizzarsi in Arial
C’è un modo per:
Evitare che iOS usi Arial se presente?
Far sì che venga usato Helvetica come fallback?
mi interessa anche capire se si può impedire ad iOS di usare Arial in lettura PDF.
Qualcuno ha affrontato un caso simile o conosce un modo affidabile per ottenere questo comportamento cross-platform?
Many of us Bangladeshi iPhone users were upset when Apple changed the font to Bangla in the most recent iOS version (18.4.1). We prefer the old Bangla typeface. I want the old Bangla typeface to return, and so do we. Please consider this.
Hi everyone,
I’ve been struggling with an issue related to the com.apple.developer.fonts-provided-by-application entitlement in Xcode. Despite configuring everything correctly, I’m still encountering an error stating that the fonts provided by application are missing.
Here’s a breakdown of what I’ve done so far:
Entitlements File:
My entitlements file includes the com.apple.developer.fonts-provided-by-application key set as an array with 28 font items listed (e.g., Lato-Bold.ttf, Montserrat-SemiBold.ttf, etc.).
All font names match the actual filenames, including extensions, and are spelled correctly.
Info.plist:
I’ve listed all the fonts under the UIAppFonts key, and they match the entries in the entitlements file.
Font Files in Xcode:
All font files are present in my project and included in Build Phases > Copy Bundle Resources.
Provisioning Profile:
The Fonts capability is enabled in my App Identifier in the Apple Developer Program, and I’ve regenerated my provisioning profile to ensure it reflects this entitlement.
What’s Working:
Other entitlements in the entitlements file (like keychain access and sandboxing) are functioning correctly, so the entitlements file is linked properly to my app target.
The provisioning profile shows everything else is in sync.
What’s Not Working:
Xcode consistently shows the error "missing fonts provided by application", even though I’ve verified the fonts, file paths, and plist entries multiple times.
Questions:
Could this issue be related to the placement of the fonts folder within my project structure?
Do I need to remove unused fonts or adjust file extensions (like .ttf vs .otf)?
Is there another step I might be missing in Xcode or the Apple Developer Program?
Any guidance would be greatly appreciated. This has been a challenging problem to resolve, and I’d love to hear from anyone who has encountered something similar.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Entitlements
Provisioning Profiles
Typography
Hello,
I am trying to match the font and the position of the date and time displayed.
This is what it looks like:
.font: NSFont.systemFont(ofSize: NSFont.systemFontSize, weight: .regular),
.foregroundColor: NSColor.labelColor,
.baselineOffset: 0.5
It looks great on built-in display, but on external 4K it is incorrect.
The baselineOffest is unnecessary, and the font looks skinny in comparison.
Can anyone comment on such issue?
when opening Main.storyboard, all screens turn black, XCode freezes, and then closes. I am adding the font according to this guide. I'm trying to add Inter-VariableFont_opsz,wght.ttf of the https://fonts.google.com/specimen/Inter
Hello, my app has a custom font for some UI elements. When building with XCODE to my local device, all works and looks great. When distributing with TestFlight, the font doesn't seem to apply!
Yes, I've included the .ttf in my Development assets, anyone else having this issue with the TestFlight Distribution of their app?
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?
We have developed an iOS app using three fonts: PingFangSC Regular, PingFangSC Medium, and DINAlternate-Bold. Do all three fonts require commercial authorization to be used in the app?
Hello!
I am looking to use SF Pro as the main font of my website. This website is used as a place of purchase for some of my products, none of which will actually be using this font.
The websites logo will also not be using this font, however I am worried that may be legally unviable.
Please let me know if this is an option. I'm not looking to get direct financial gain by using your fonts, just would like to use it for the website.
Thank you for your help.
My app lets users create things with text, and I've included Apple fonts so users can format their text with them. These were fonts I found in the Font Book app that comes with macOS. My assumption is that these, like the San Francisco font, can be distributed with apps.
Do I need to attribute these fonts to their creators and publish a license in my "About" page? If so, where do I find the license(s) and what is the proper way of publishing them? Is there anything else I should know?
Please let me know if this should've been posted under a different topic and tag
This is a follow-up to my previous question: How to attribute/credit Apple Fonts added to app?
In that previous post, I misremembered what I did and said I found fonts via macOS' FontBooks, when instead I came acrossUIFont.familyNames. Since these are included via UIKit, the legal implications should be different.
I looked at various license agreements that govern iOS app development but haven't found anything mentioning fonts. Since these are included as part of UIKit, its reasonable to assume that developers are allowed to include these fonts--but in what ways?
Am I allowed to let users create, say, documents with these fonts?
Am I only allowed to display these fonts?
There are 84 fonts, and judging by their FontBook entries, there is a wide range of licenses and restrictions. It seems unnecessarily harsh to have every iOS developer verify each one and figure out which they can legally keep if they want to offer their users access to all (for, say, a text-editing app). There must be some overarching rule that supersedes/encapsulates them, but this rule isn't clear to me after hours of research. I'm not a lawyer, and I don't think Apple expects every app developer to consult their lawyers on whether they can use system fonts.
I'm about to send an email to Apple's legal team (I will post their response here if allowed), but in the meantime I want to hear what other devs think about this.
In Xcode, entering UIFont.familyNames returns the following:
["Academy Engraved LET", "Al Nile", "American Typewriter", "Apple Color Emoji", "Apple SD Gothic Neo", "Apple Symbols", "Arial", "Arial Hebrew", "Arial Rounded MT Bold", "Avenir", "Avenir Next", "Avenir Next Condensed", "Baskerville", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni Ornaments", "Bradley Hand", "Chalkboard SE", "Chalkduster", "Charter", "Cochin", "Copperplate", "Courier New", "Damascus", "Devanagari Sangam MN", "Didot", "DIN Alternate", "DIN Condensed", "Euphemia UCAS", "Farah", "Futura", "Galvji", "Geeza Pro", "Georgia", "Gill Sans", "Grantha Sangam MN", "Helvetica", "Helvetica Neue", "Hiragino Maru Gothic ProN", "Hiragino Mincho ProN", "Hiragino Sans", "Hoefler Text", "Impact", "Kailasa", "Kefa", "Khmer Sangam MN", "Kohinoor Bangla", "Kohinoor Devanagari", "Kohinoor Gujarati", "Kohinoor Telugu", "Lao Sangam MN", "Malayalam Sangam MN", "Marker Felt", "Menlo", "Mishafi", "Mukta Mahee", "Myanmar Sangam MN", "Noteworthy", "Noto Nastaliq Urdu", "Noto Sans Kannada", "Noto Sans Myanmar", "Noto Sans Oriya", "Optima", "Palatino", "Papyrus", "Party LET", "PingFang HK", "PingFang SC", "PingFang TC", "Rockwell", "Savoye LET", "Sinhala Sangam MN", "Snell Roundhand", "STIX Two Math", "STIX Two Text", "Symbol", "Tamil Sangam MN", "Thonburi", "Times New Roman", "Trebuchet MS", "Verdana", "Zapf Dingbats", "Zapfino"]
I like this font. but in license only allowed for use in Mockup UI.
Feel free to use in commercial?
https://mobbin.com/apps/bloom-ios-e1251835-34e6-426e-9f94-f9595f2567fa/1c919e9a-d144-4aa0-b788-f9752111e281/screens
What type of licensing does it apply for the usage of FONT_FAMILY='System' in Apple/iOS app?
In this UIKit app, I have to display numbers (from 1 to 100), in a label., on several lines, with 8 numbers on each line. Order is computed by the app for a specific purpose.
The numbers are separated by space. Label font is Helvetica Neue 15.0.
I want to get them aligned vertically.
So, I have a padding so that they are all the same length of 4.
Problem: the space have smaller width (half in fact) than digits, so alignment is disrupted:
Of course, I can use fixed width fonts (like Menlo), but I've not found one that fits (the zero is barred, which is not looking great in the app).
I have tried using
class func monospacedDigitSystemFont(
ofSize fontSize: CGFloat,
weight: UIFont.Weight
) -> UIFont
and apply to label.text. To no avail as it modifies only digits, not space char.
I have found a workaround, padding with 2 spaces instead of one,
but is there another solution ?
So I am looking for a space character that would have the same width as a digit. There existe thin space (https://en.wikipedia.org/wiki/Whitespace_character) but not larger space.
Does it exist ?
Helvetica (17.0d1e1) has bugs, hopefully the developers and designers will fix it.
Link to the presentation: https://drive.google.com/file/d/16qfpo9Y7Psghv5c_Xl3JBiTPkP4QNaaS/view?usp=sharing