Apple's Autoscanning iTunes Card Promo Codes Work via Hidden Font, Can be Replicated by Devs

When you purchase an iTunes gift card and redeem it in the App Store, the camera on your iPhone, iPad, or Mac can scan the code on the card to recognize it automatically, saving you the time of typing the numbers in manually.

Equinux, the company behind Mail Designer Pro 3, dug into how Apple's promo code engine works in an effort to make their own scannable cards, and the results are quite interesting. As it turns out, the scanning feature in the App Store is tuned to recognize two things: a unique, hidden font and the dimensions of the box around it.

itunescardpromocode
Equinux tried the box alone with a range of fonts like Courier and Monaco, and attempted to identify the unique characteristics of the font to find it, but were unsuccessful. Ultimately, the team realized the font that Apple's using is hidden deep within iTunes.

The breakthrough came when we noticed that when you scan a card with your iPhone, the app briefly displays a "scanned" overlay of the code. This means the font must be embedded in the app somewhere. We tried the same with iTunes on macOS. And voila - the iTunes on Mac behaves the same way.

When you look at some of the other folders inside iTunes, we found a tantalizing plugin called "CodeRedeemer." It showed promise. But alas, no font files there either. The app binary does give a hint of where the heavy lifting is being done: "CoreRecognition.framework."

Hidden in the CoreRecognition.framework, there are two fonts: "Scancardium," for entering and recognizing codes, and "Spendcardium," which appears to be for obscuring credit card details as they're entered. The two fonts can be found by going to Finder on a Mac, clicking Go, choosing Go to Folder and pasting the following: /System/Library/PrivateFrameworks/CoreRecognition.framework/Resources/Fonts/

With a simple double click, the fonts can be installed on a Mac and can be used within different apps. While this is a neat breakdown for end users, it's of particular interest to developers because these fonts can be used to create custom App Store promo code cards that can be scanned in the same way as iTunes gift cards.

appstorepromocodecustom
Equinux outlines the exact font height to use and how to position it within the surrounding box to get Apple's engine to recognize it, details the company uncovered after investing a lot of time in tweaking fonts and the border of the required box.

Equinux even went one step further and created helpful Sketch and Photoshop templates that developers can use to create App Store promo code cards that can be automatically scanned using a device camera and recognized by the App Store.

Related Forum: Mac Apps

Top Rated Comments

linkmaster02 Avatar
87 months ago
Is it legal to use the font in your own promo materials?
Score: 10 Votes (Like | Disagree)
ckelley Avatar
87 months ago
Probably the same one that's used for scanning HomeKit keys as well, the font looks similar.
Score: 8 Votes (Like | Disagree)
cateye Avatar
87 months ago
There's nothing "secret" about using a font this way. There have been specialty fonts that make for easy and reliable optical character recognition (OCR) via "fuzzy" recognition (e.g. using a photograph) for years. Apple may have developed their own font for whatever reason, but there are literally dozens of speciality typefaces that allow for this. Barcodes work this way as well. Microsoft made a stink at one point how you could hold up a MS gift card in front of a Kinect and have it read similarly quickly. It's a bit of a parlor trick, but does save you from having to type in all those letters and numbers.
Score: 8 Votes (Like | Disagree)
Appurushido Avatar
87 months ago
Apple technology, not always the first, but they make sure they always try to make it the best!
Score: 5 Votes (Like | Disagree)
TechRemarker Avatar
87 months ago
Since one can only presume that font is licensed by Apple, not sure how developers would be able to use it legally unless Apple some day officially extends the feature to develops and open sources the font.
Score: 4 Votes (Like | Disagree)
justperry Avatar
87 months ago
PS: I'm almost certain it doesn't even scan the font but the barcode below it.
I just scanned a Homekit accessory code (It's similar), there wasn't any barcode under it so you are wrong.
Score: 3 Votes (Like | Disagree)

Popular Stories

iPhone 16 Camera Lozenge 2 Perspective Gray

Five Key Upgrades Coming to iPhone 16

Friday March 15, 2024 1:45 pm PDT by
The iPhone is Apple's top-selling product, and it gets an update every year. In 2024, we're expecting the iPhone 16 and iPhone 16 Pro lineup, with an arguably more interesting feature set than we got with the iPhone 15 and iPhone 15 Pro. Subscribe to the MacRumors YouTube channel for more videos. Capture Button All four iPhone 16 models are set to get a whole new button, which will be...
When To Expect New iPads Feature 1

Apple to Announce New iPads on March 26, Rumors Claim

Monday March 18, 2024 4:02 am PDT by
Apple is widely expected to release new iPad Air and OLED iPad Pro models in the next few weeks. According to new rumors coming out of Asia, the company will announce its new iPads on Tuesday, March 26. Chinese leaker Instant Digital on Weibo this morning 日发布%23">claimed that the date will see some sort of announcement from Apple related to new iPads, but stopped short of calling it an...
airpods 3 orange

Two New AirPods 4 Models Expected to Launch in September or October

Sunday March 17, 2024 7:56 am PDT by
Apple suppliers will begin production of two new fourth-generation AirPods models in May, according to Bloomberg's Mark Gurman. Based on this production timeframe, he expects the headphones to be released in September or October. Gurman expects both fourth-generation AirPods models to feature a new design with better fit, improved sound quality, and an updated charging case with a USB-C...
iphone se 4 modified flag edges

iPhone SE 4 Expected to Depreciate Heavily

Tuesday March 12, 2024 9:04 am PDT by
Resale value trends suggest the iPhone SE 4 may not hold its value as well as Apple's flagship models, according to SellCell. According to the report, Apple's iPhone SE models have historically depreciated much more rapidly than the company's more premium offerings. The third-generation iPhone SE, which launched in March 2022, experienced a significant drop in resale value, losing 42.6%...
iOS 17 Passkey With Apple ACCOUNT Feature

'Apple ID' Expected to Change to 'Apple Account' Starting With iOS 18

Sunday March 17, 2024 7:13 am PDT by
MacRumors was first to report that Apple was planning to rebrand "Apple ID" to "Apple Account" across its software platforms and websites like iCloud.com as early as this year, and now Bloomberg's Mark Gurman has corroborated this change. A mockup of the new Apple Account branding In his Power On newsletter today, Gurman said the new "Apple Account" branding will start to be used later this...
General iOS 17 Feature Orange Purple

iOS 17.4.1 Update for iPhone is Imminent

Monday March 18, 2024 5:27 am PDT by
iOS 17.4.1 and iPadOS 17.4.1 should be released within the next few days, with a build number of 21E235, according to a source with a proven track record. MacRumors previously reported that Apple was internally testing iOS 17.4.1. As a minor update for the iPhone, it will likely address software bugs and/or security vulnerabilities. It is unclear if the update will include any other changes. ...
M3 iPad Feature 3

New iPads Likely to Begin Shipping in April

Monday March 18, 2024 9:52 am PDT by
Apple's new iPad Pro models with OLED displays will likely begin shipping to customers in April, according to information shared today by Ross Young, CEO of display industry research firm Display Supply Chain Consultants. Bloomberg's Mark Gurman also said the new iPad Pro models might not ship until "deeper" into April in his Power On newsletter on Sunday:I've repeatedly said that new...