gpt4 book ai didi

ios - CGContextShowTextAtPoint 和欧元符号

转载 作者:行者123 更新时间:2023-11-29 11:13:31 25 4
gpt4 key购买 nike

我正在使用以下内容在 iOS 中的 PDF 上绘制文本:

CGContextSelectFont (pdfContext, "Helvetica Bold", 14, kCGEncodingMacRoman);
NSString *str1 = [NSString stringWithString:@"€ 10"];
CGContextShowTextAtPoint(pdfContext, 25, y-60 , [str1 cStringUsingEncoding:NSMacOSRomanStringEncoding], [str1 length]);

欧元符号显示为正方形。

你有什么建议吗?

附言。我也尝试过 [str1 UTF8String],结果相同

最佳答案

在大多数情况下,使用 NSString 方法更容易 - (CGSize)drawAtPoint:(CGPoint)point withFont:(UIFont *)font- (CGSize)drawInRect:(CGRect) rect withFont:(UIFont *)font 而不是 CoreGraphic 等价物。 Apple 会为您考虑正确的转换、编码等问题。

关于ios - CGContextShowTextAtPoint 和欧元符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10457285/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com