Reputation: 5458
I have a PDF file with a font reference to STSong-Light which is not available on the iOS.
Therefor I can not display the correct characters defined with that font.
I took the STSong font file mentioned on Apples KB: http://support.apple.com/kb/ht1538
… and put it into my project and added it to the plist.
The text is now no longer being rendered.
I'm using CGContextDrawPDFPage to render my PDF files.
My question is:
How can I correctly get my font file working OR can I somehow access on the iOS available fonts to replace STSong fonts in my PDF? (there must be other asian fonts, otherwise these interfaces wouldn't work)
Thank you all in advance for your help!
Edit: I got some Feedback from Apple that I could also use a font-substitute which means the second part of the question should be the right direction.
Added: This is the source which opens the PDF Files:
CFURLRef pdfURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)pdfFilename, kCFURLPOSIXPathStyle, false);
CGPDFDocumentRef pdfRef = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfRef, page);
[..]
Upvotes: 1
Views: 505
Reputation: 2056
The font may not be as important as the encoding. If you are setting the encoding value for the document, try using 0x80000421. I have an application that presents Kanji text using the Helvetica font but with a string encoding of 0x80000421
Try This: Instead of using CGURLCreateWithFileSystemPath(), try loading the file contents into an NSData object and use CFURLCreateWithBytes() using that NSData contents and use 0x80000421 as the value for CGStringEncodingRef
Upvotes: 1