iOS 7.0.3에서“HelveticaNeue-Italic”에 발생한 일
iPod touch를 iOS 7.0.3으로 업그레이드했는데 "HelveticaNeue-Italic"이 사라진 것 같습니다. 다음을 사용하여 전화로 쿼리 할 때 :
[UIFont fontNamesForFamilyName:@"Helvetica Neue"]
다음 fontNames (13)를 얻습니다.
HelveticaNeue-BoldItalic,
HelveticaNeue-Light,
HelveticaNeue-UltraLightItalic,
HelveticaNeue-CondensedBold,
HelveticaNeue-MediumItalic,
HelveticaNeue-Thin,
HelveticaNeue-Medium,
HelveticaNeue-ThinItalic,
HelveticaNeue-LightItalic,
HelveticaNeue-UltraLight,
HelveticaNeue-Bold,
HelveticaNeue,
HelveticaNeue-CondensedBlack
시뮬레이터에서 동일한 쿼리를 실행하면 (14) :
HelveticaNeue-BoldItalic,
HelveticaNeue-Light,
**HelveticaNeue-Italic,**
HelveticaNeue-UltraLightItalic,
HelveticaNeue-CondensedBold,
HelveticaNeue-MediumItalic,
HelveticaNeue-Thin,
HelveticaNeue-Medium,
HelveticaNeue-Thin_Italic,
HelveticaNeue-LightItalic,
HelveticaNeue-UltraLight,
HelveticaNeue-Bold,
HelveticaNeue,
HelveticaNeue-CondensedBlack
다른 사람이 보셨나요?
---- 새로운 정보 ----
WWDC 2013 비디오 "텍스트 키트와 함께 글꼴 사용"으로 돌아가서 흥미로운 부분은 12:22에 시작됩니다. 발표자는 OS X의 "MetaFonts"를 예로 들어 설명합니다. 그가 말하는 것은 아래의 글꼴이 다음과 같이 호출된다는 것입니다.
+ (NSFont *)messageFontOfSize:(CGFloat)fontSize
버전 또는 용도에 따라 동일한 기본 글꼴을 반환하지 않을 수도 있습니다. 그의 예는 Lucinda Grande였습니다. 그는 "HelveticaNeue-Italic"을 사용하는 것이 버전간에 사라질 수 있다고 말하는 것 같지 않았습니다.
그래서 iOS 7에서 실험을 구성했습니다. 다음 코드로 글꼴을 만들었습니다.
UIFontDescriptor *fontDescriptor = [UIFontDescriptor fontDescriptorWithName:@"Helvetica Neue" size:16.0];
UIFontDescriptor *symbolicFontDescriptor = [fontDescriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitItalic];
UIFont *fontWithDescriptor = [UIFont fontWithDescriptor:symbolicFontDescriptor size:16.0];
fontWithDescriptor에 대해 유효한 UIFont를 얻었고 fontName의 글꼴을 다음과 같이 쿼리했을 때 :
[fontWithDescriptor fontName]
나는 돌아왔다...
HelveticaNeue-Italic
그림을 이동???
따라서 7.0.3에 대한 가능한 대답은 위의 코드 인 것 같습니다.
---- 추가 조정 ----
솔루션이 위에서 작동했지만 공식적으로 옳다고 생각하지 않습니다. 다음 솔루션으로 전환했습니다.
UIFontDescriptor *fontDescriptor = [[UIFontDescriptor alloc] init];
UIFontDescriptor *fontDescriptorForHelveticaNeue = [fontDescriptor fontDescriptorWithFamily:@"Helvetica Neue"];
UIFontDescriptor *symbolicFontDescriptor = [fontDescriptorForHelveticaNeue fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitItalic];
textFont = [UIFont fontWithDescriptor:symbolicFontDescriptor size:textFontPointSize];
이것은 모든 옳은 일을하는 것처럼 보입니다. 다른 글꼴 패밀리로 이전 접근 방식을 시도했는데 fontName 및 fontFamily와 혼동되는 것 같습니다. 도움이 되었기를 바랍니다!
이것은 Apple 버그입니다. iOS 7.0.3에서 도입되었으며 아직 iOS 7.0.4에서 수정되지 않았습니다. iOS 7.1의 개발자 미리보기에서 수정 된 것으로 보입니다. 다음은 문제를 해결하기위한 코드 (개발자 포럼에서 Apple 제공)입니다.
#import <CoreText/CoreText.h>
CGFloat size = 14;
UIFont *font = [UIFont fontWithName:@"HelveticaNeue-Italic" size:size];
if (font == nil && ([UIFontDescriptor class] != nil)) {
font = (__bridge_transfer UIFont*)CTFontCreateWithName(CFSTR("HelveticaNeue-Italic"), size, NULL);
}
It is also worth noting that in the current version of Xcode (5.0.1 (5A2053)) this font is not listed as an option in the Font drop down list in Interface Builder. So if you previously configured a label with this font you will notice that the ui is confused and the label ends up being assigned some other font and size at runtime (see ui screencap below). For labels configured in storyboards/xibs you will need to reset the font in code.
For reference here is the discussion of the issue in the dev forums.
This is a bug in iOS 7.0.3.
If you are explicitly using HelveticaNeue-Italic, then you can create it using this workaround:
UIFont* font = (__bridge_transfer UIFont*)CTFontCreateWithName(CFSTR("HelveticaNeue-Italic"), fontSize, NULL);
Note, however, that this workaround will only work on iOS 7; it is not deployable to iOS 6 (because CTFontRef
and UIFont
were not toll-free bridged on iOS 6). However, on iOS 6 you can just use your regular font lookup code.
It is my belief that it is a bug. I have filed it as such with Apple. Sadly for me, my app is now crashing. The font is used in a 3rd party library I am using. Many folks on Twitter are reporting problems.
If you are dynamically accessing the italic font then instead of accessing the font by name [UIFont fontWithName:@"HelveticaNeue-Italic" size:15.0f]
use [UIFont italicSystemFontOfSize:15.0f]
this is working fine for me.
I currently don't find the session but they said something that you can not rely on fonts being available anymore on iOS7. They can even change during the lifetime of your app. Which basically means: When you specify fonts in your app, you are screwed, use font descriptors or preferred fonts instead!
I've found another solution that seems to work. I logged out a call to
[[UIFont italicSystemFontOfSize:12.0] fontName]
to see what the actual system italic font being used is, and it returned ".HelveticaNeueInterface-ItalicM3". A simple test shows that using
[UIFont fontWithName:@".HelveticaNeueInterface-ItalicM3" size:12.0]
works! Comparing them visually, the font returned by the above call appears to be exactly the same as the original 'HelveticaNeue-Italic' font.
This problem is almost certainly a bug... Helvetica Neue is the default font in iOS 7, so fonts in that family shouldn't be missing. Everything worked fine in Xcode v.5.0, but immediately after upgrading to 5.0.1, this issue started appearing. I've filed a bug with Apple noting as much. Until then, this solution seems to work...
The bug report I filed with Apple has been marked "Closed as duplicate". I am hopeful that means they do consider it a bug. However, iOS 7.0.4 does not fix the bug.
The bug seems to have been fixed in iOS 7.1 beta 1. [UIFont fontWithName:@"HelveticaNeue-Italic" size:size];
returns a font.
I had a same crash which used be to crash in iOS 7.0.3 & 7.0.4 only, and works perfectly in all other versions. After so much investigation, I came to know that @"HelveticaNeue-Italic" is not available in iOS 7.0.3 & 7.0.4 versions, so that I used to get above crash in those versions.
I have fixed the issue with below code, this might helpful to someone needy.
self.headerFont = [UIFont fontWithName:@"HelveticaNeue-Italic" size:16.0f];
if (self.headerFont == nil) {
self.headerFont = [UIFont fontWithName:@"HelveticaNeue" size:16.0f];
}
The crash log is:
[__NSCFConstantString pointSize]: unrecognized selector sent to instance
Since no one has mentioned anything about HelveticaNeue italic support in UIWebView, I thought I'd share my findings.
As of 7.0.6, the regular italic is still missing in UIWebView and appears to fall back to UltraLightItalic in the same family. This looks a little weird when it's right next to regular weight non-italic HelveticaNeue text since it is so much lighter.
My workaround was to use ordinary Helvetica instead of HelveticaNeue, but only for the italics. So if you have CSS that looks like this:
.myCssClass {
font-family:HelveticaNeue;
/* etc, etc */
}
...you would add two other classes to override <i>
and <em>
:
.myCssClass i { font-family:Helvetica; }
.myCssClass em { font-family:Helvetica; }
The regular Helvetica italic font looks fine and I don't think anyone would notice that it's not HelveticaNeue.
참고URL : https://stackoverflow.com/questions/19527962/what-happened-to-helveticaneue-italic-on-ios-7-0-3
'Programming' 카테고리의 다른 글
MPI 타입 맵 표시 (0) | 2020.08.19 |
---|---|
VC ++ 코드 DOM은 VS 애드온에서 액세스 할 수 있습니까? (0) | 2020.08.19 |
누군가 SBT를 사용하는 올바른 방법을 설명 할 수 있습니까? (0) | 2020.08.19 |
f : selectItem (s)에서 열거 형 값을 사용하는 방법 (0) | 2020.08.18 |
pip를 사용하여 Windows에 PyQt4를 설치하는 방법은 무엇입니까? (0) | 2020.08.18 |