Embedding a font within dyslexic assisting app
I am a Design teacher in Belfast and I have a 12 year old student who has designed a font for dyslexic readers.
We have bodged an app by snipping open source stuff from across the web. we have a fairly functional app, Where:
- User takes pic
- Selects pic
- OCRs the text 4 Presents text in a font of choice (dyslexia.ttf)
I have be able to change the font to any of the custom fonts, but not to the one of choice. I am very unsure of the code (not a clue)
this has been an app to add on to the design of the students font (with the font being the main feature....can anyone PLEASE shed some light? I have tried with and without.ttf, I, to my knowledge am sure all is embedded and bundled etc...to no avail.
all is viewable at the above link on github I have googled it to death And following tweak after tweak, I am done...apologies for the request only, but this is not my area of expertise at all, but will add the icing on the cake to my students project.
Many thanks Sammy
This works as of iOS 3.2, and is pretty straightforward. You need to follow these steps:
- Copy the TTF file into the Resources folder in Xcode, so it gets copy inside the app bundle when you compile the app.
Edit your Info.plist file and add the following key:
<key>UIAppFonts</key> <array> <string>dyslexia.ttf</string> </array>
From within the app, you can instantiate a UIFont by calling:
[UIFont fontWithName:@"dyslexia" size:12];
and set that to the font property of a UILabel for instance.
One important thing to note, though: the name of the font you pass to + fontWithName: is not necessarily the name of the ttf file, but the name of the font within the font metadata. Make sure you are using the proper name there.