Skip to content
jp5or edited this page Jan 15, 2015 · 24 revisions

Anemone fonts are bundles located at /Library/CustomFonts. They contain all variants of the font as TTF or OTF files as well as an Info.plist. You can set your own font in the Anemone app, or themes can pick defaults.

The Anemone Font Pack contains popular open source fonts. Anemone also supports all fonts included with iOS and fonts downloadable from Apple, listed here.

BytaFont 2 fonts are supported but deprecated due to their modified nature to support BytaFont's outdated way of theming fonts. All variants of a font will be modified with no ability to . Due to sandbox restrictions, /var/mobile/Library/MyFonts2 is moved to /Library/CustomFonts/BytaFont2 and symlinked by Anemone.

Anemone requires font names to match a specific PostScript name, like Roboto-Regular. The family name, like Roboto, isn't supported. On a mac you can find the name in Font Book with View > Show Font Info.

Setting fonts in a theme

Font settings are controllable via themes using the following keys in the theme's Info.plist. Note user selected fonts override theme fonts.

FontName-*

This string allows you to override a specific font by its PostScript name. Example:

<key>FontName-AvenirNext-Bold</key>
<string>TrebuchetMS-Bold</string>

Font-SystemFont

This string allows you to override the default system font returned when apps use [UIFont systemFontOfSize:].

Font-BoldSystemFont

This string allows you to override the default system font returned when apps use [UIFont systemFontOfSize:]. If this isn't set, it'll be inferred from Font-SystemFont.

Font-ItalicSystemFont

This string allows you to override the default system font returned when apps use [UIFont systemFontOfSize:]. If this isn't set, it'll be inferred from Font-SystemFont.

Font-[Headline, Subheadline, Body, Footnote, Caption1, Caption2]

These strings allow you to override iOS 7 Dynamic Type fonts. Note the headline is different from the navigation bar. Not all apps use these, but on iOS 8 the body font is used for table cells. See Text Programming Guide for iOS.

Font-Keyboard

This string allows you to override the font used for the keyboard.

Font-LockClock

This string allows you to override the font used for the lock screen clock.

Font-NavigationBar

This string allows you to override the font used in navigation bars.

Font-StatusBar

This string allows you to override the font used for the status bar.

Making a font package

Anemone font packages can be made easily with Theos. You can use this makefile:

include theos/makefiles/common.mk

BUNDLE_NAME = Roboto
Roboto_INSTALL_PATH = /Library/CustomFonts

include $(THEOS_MAKE_PATH)/bundle.mk

You don't need to use Theos but it makes packaging easier. No source code is used. The control file should have the section "Fonts" and depend on com.anemonetheming.anemone.

Create a directory called Resources and copy the fonts there. All TTF and OTF files are loaded if the font is active. Hopefully you're using an open source font or have licensed the font and can include the license as LICENSE.txt. Create a file called Info.plist and fill it in:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ANEMFontMapping</key>
	<dict>
		<key>Black</key>
		<string>Roboto-Black</string>
		<key>BlackItalic</key>
		<string>Roboto-BlackItalic</string>
		<key>Bold</key>
		<string>Roboto-Bold</string>
		<key>BoldItalic</key>
		<string>Roboto-BoldItalic</string>
		<key>Italic</key>
		<string>Roboto-Italic</string>
		<key>Light</key>
		<string>Roboto-Light</string>
		<key>LightItalic</key>
		<string>Roboto-LightItalic</string>
		<key>Medium</key>
		<string>Roboto-Medium</string>
		<key>MediumItalic</key>
		<string>Roboto-MediumItalic</string>
		<key>Regular</key>
		<string>Roboto-Regular</string>
		<key>Thin</key>
		<string>Roboto-Thin</string>
		<key>ThinItalic</key>
		<string>Roboto-ThinItalic</string>
		<key>UltraLight</key>
		<string>Roboto-Thin</string>
		<key>UltraLightItalic</key>
		<string>Roboto-ThinItalic</string>
	</dict>
	<key>CFBundleDisplayName</key>
	<string>Roboto</string>
	<key>CFBundleIdentifier</key>
	<string>com.example.font.roboto</string>
	<key>NSHumanReadableCopyright</key>
	<string>Font data copyright Google 2014</string>
</dict>
</plist>

CFBundleDisplayName should match the family name, NSHumanReadableCopyright should match the copyright field on the font, and CFBundleIdentifier should be unique for each font.

ANEMFontMapping

This dictionary provides a mapping of font styles to the matching PostScript name for the font. See above for an example. Font weights are in the following order: ultra light, thin, light, regular, medium, bold, black. You can use this to fix a font with styles in a different order, as Roboto does with its thin and light styles. Regular, Bold, Italic and BoldItalic are required. The rest are optional. Black is unused by iOS currently but a theme may want to use it.

ANEMIsEmojiFont

Emoji can be themed with Anemone. You need a font that contains the bitmaps in Apple format, see the Apple TrueType Reference Manual. Instead of a ANEMFontMapping key, set ANEMIsEmojiFont to true.

Clone this wiki locally