Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1502)

Unified Diff: test/idempotent.cc

Issue 13449003: [OTS] Make standalone tools compile on Mac (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cff_type2_charstring.cc ('k') | test/validator-checker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/idempotent.cc
===================================================================
--- test/idempotent.cc (revision 98)
+++ test/idempotent.cc (working copy)
@@ -110,32 +110,24 @@
#elif defined(__APPLE_CC__)
// Mac
bool VerifyTranscodedFont(uint8_t *result, const size_t len) {
- ATSFontContainerRef container_ref = 0;
- ATSFontActivateFromMemory(result, len, 3, kATSFontFormatUnspecified,
- NULL, kATSOptionFlagsDefault, &container_ref);
- if (!container_ref) {
+ CFDataRef data = CFDataCreate(0, result, len);
+ if (!data) {
return false;
}
- ItemCount count;
- ATSFontFindFromContainer(
- container_ref, kATSOptionFlagsDefault, 0, NULL, &count);
- if (!count) {
+ CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(data);
+ CGFontRef cgFontRef = CGFontCreateWithDataProvider(dataProvider);
+ CGDataProviderRelease(dataProvider);
+ CFRelease(data);
+ if (!cgFontRef) {
return false;
}
- ATSFontRef ats_font_ref = 0;
- ATSFontFindFromContainer(
- container_ref, kATSOptionFlagsDefault, 1, &ats_font_ref, NULL);
- if (!ats_font_ref) {
+ size_t numGlyphs = CGFontGetNumberOfGlyphs(cgFontRef);
+ CGFontRelease(cgFontRef);
+ if (!numGlyphs) {
return false;
}
-
- CTFontRef ct_font_ref = CTFontCreateWithPlatformFont(ats_font_ref, 12,
- NULL, NULL);
- if (!CTFontGetGlyphCount(ct_font_ref)) {
- return false;
- }
return true;
}
« no previous file with comments | « src/cff_type2_charstring.cc ('k') | test/validator-checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698