Skip to content

Commit

Permalink
Added test cases for known CoreText issues
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Jun 21, 2012
1 parent f2ed9b6 commit aaf5992
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Core/Source/DTCoreTextFontDescriptor.m
Expand Up @@ -70,7 +70,8 @@ + (void)initialize
// workaround for iOS 5.x bug: global font cascade table has incorrect bold font for Chinese characters in Chinese locale
DTSimpleVersion version = [[UIDevice currentDevice] osVersion];

if (version.major>4)
// seems to be fixed in iOS 6
if (version.major<6)
{
_needsChineseFontCascadeFix = YES;
}
Expand Down
4 changes: 4 additions & 0 deletions DTCoreText.xcodeproj/project.pbxproj
Expand Up @@ -37,6 +37,7 @@
A70F11DF148632CD009202BF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
A71B927114E0165000360C30 /* PreWhitespace.html in Resources */ = {isa = PBXBuildFile; fileRef = A71B927014E0165000360C30 /* PreWhitespace.html */; };
A71B927314E016A300360C30 /* PreWhitespace.plist in Resources */ = {isa = PBXBuildFile; fileRef = A71B927214E016A300360C30 /* PreWhitespace.plist */; };
A72C15C71592FAF70064A67F /* CoreTextIssues.html in Resources */ = {isa = PBXBuildFile; fileRef = A72C15C61592FAF70064A67F /* CoreTextIssues.html */; };
A73BC42912DA014300F064C6 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A73BC42812DA014300F064C6 /* CoreText.framework */; };
A74C953614DC0C69002B5A45 /* MalformedURL.html in Resources */ = {isa = PBXBuildFile; fileRef = A74C953514DC0C69002B5A45 /* MalformedURL.html */; };
A74C973E14DC5294002B5A45 /* Emoji.html in Resources */ = {isa = PBXBuildFile; fileRef = A74C973D14DC5294002B5A45 /* Emoji.html */; };
Expand Down Expand Up @@ -485,6 +486,7 @@
A70F11DE148632CD009202BF /* libDTCoreText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDTCoreText.a; sourceTree = BUILT_PRODUCTS_DIR; };
A71B927014E0165000360C30 /* PreWhitespace.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = PreWhitespace.html; sourceTree = "<group>"; };
A71B927214E016A300360C30 /* PreWhitespace.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = PreWhitespace.plist; sourceTree = "<group>"; };
A72C15C61592FAF70064A67F /* CoreTextIssues.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = CoreTextIssues.html; sourceTree = "<group>"; };
A73BC42812DA014300F064C6 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
A74C953514DC0C69002B5A45 /* MalformedURL.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MalformedURL.html; sourceTree = "<group>"; };
A74C973D14DC5294002B5A45 /* Emoji.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Emoji.html; sourceTree = "<group>"; };
Expand Down Expand Up @@ -878,6 +880,7 @@
A7D54EA414E003190063E78B /* Objects.html */,
A7A95D9414F3F45E002E3F7E /* LineHeight.html */,
A78C241015073BC50045651E /* TextBoxes.html */,
A72C15C61592FAF70064A67F /* CoreTextIssues.html */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -1344,6 +1347,7 @@
A7D54EA514E003190063E78B /* Objects.html in Resources */,
A7A95D9514F3F45E002E3F7E /* LineHeight.html in Resources */,
A78C241115073BC50045651E /* TextBoxes.html in Resources */,
A72C15C71592FAF70064A67F /* CoreTextIssues.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
12 changes: 12 additions & 0 deletions Demo/Resources/CoreTextIssues.html
@@ -0,0 +1,12 @@
<h2>Core Text Bugs</h2>
<h3>Bold for Chinese Glyphs</h3>
<p>This is a bug that was present before iOS 6, the Chinese glyphs in the following line would be bold if the locale was set to Chinese due to an incorrect entry in the global font cascade table. Filed as rdar://11262229</p>
<p style='font-size:25.0pt'>English and 中文 -- Chinese characters </p>

<h3>Italic for Chinese Glyphs in Fallback</h3>
<p style="font-size:25px;">东方盖饭</p>
<p style="font-size:25px;font-style:italic;">东方盖饭</p>

<h3>Extra space above lines with whitespace glyphs</h3>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
<p style="font-family:Helvetica;font-size:30px;">Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla Bla bla </p>
8 changes: 8 additions & 0 deletions Demo/Resources/Snippets.plist
Expand Up @@ -124,6 +124,14 @@
<key>Title</key>
<string>Text Boxes</string>
</dict>
<dict>
<key>Description</key>
<string>Test Cases for known issues in CoreText</string>
<key>File</key>
<string>CoreTextIssues.html</string>
<key>Title</key>
<string>Known CoreText Issues</string>
</dict>
<dict>
<key>Description</key>
<string>This is whatever Oliver is currently playing with. Don&apos;t touch that! &lt;img src=&quot;icon_smile.gif&quot;&gt;</string>
Expand Down

0 comments on commit aaf5992

Please sign in to comment.