iOS Quartz embed font in pdf
问题 I'm trying to generate a PDF page with text that has custom symbols (e.g. "€") using a custom font. I've created a PDF context and page using UIGraphicsBeginPDFContextToData and UIGraphicsBeginPDFPage. My code for rendering text looks something like: NSString *fontFile = [[NSBundle mainBundle] pathForResource:@"somefont.otf" ofType:nil]; CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([fontFile cStringUsingEncoding:NSASCIIStringEncoding]); CGFontRef cgfont =