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

Side by Side Diff: Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzFaceCoreText.cpp

Issue 10815078: Merge 121510 - [Chromium] CTFontCopyTable of MacOSX10.5 SDK doesn't work for layout tables (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 static void releaseTableData(void* userData) 103 static void releaseTableData(void* userData)
104 { 104 {
105 CFDataRef cfData = reinterpret_cast<CFDataRef>(userData); 105 CFDataRef cfData = reinterpret_cast<CFDataRef>(userData);
106 CFRelease(cfData); 106 CFRelease(cfData);
107 } 107 }
108 108
109 static hb_blob_t* harfbuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData) 109 static hb_blob_t* harfbuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
110 { 110 {
111 FontPlatformData* platformData = reinterpret_cast<FontPlatformData*>(userDat a); 111 FontPlatformData* platformData = reinterpret_cast<FontPlatformData*>(userDat a);
112 CTFontRef ctFont = platformData->ctFont(); 112 // It seems that CTFontCopyTable of MacOSX10.5 sdk doesn't work for
113 CFDataRef cfData = CTFontCopyTable(ctFont, tag, kCTFontTableOptionNoOptions) ; 113 // OpenType layout tables(GDEF, GSUB, GPOS). Use CGFontCopyTableForTag inste ad.
114 CGFontRef cgFont = platformData->cgFont();
115 CFDataRef cfData = CGFontCopyTableForTag(cgFont, tag);
114 if (!cfData) 116 if (!cfData)
115 return 0; 117 return 0;
116 118
117 const char* data = reinterpret_cast<const char*>(CFDataGetBytePtr(cfData)); 119 const char* data = reinterpret_cast<const char*>(CFDataGetBytePtr(cfData));
118 const size_t length = CFDataGetLength(cfData); 120 const size_t length = CFDataGetLength(cfData);
119 if (!data || !length) 121 if (!data || !length)
120 return 0; 122 return 0;
121 return hb_blob_create(data, length, HB_MEMORY_MODE_READONLY, reinterpret_cas t<void*>(const_cast<__CFData*>(cfData)), releaseTableData); 123 return hb_blob_create(data, length, HB_MEMORY_MODE_READONLY, reinterpret_cas t<void*>(const_cast<__CFData*>(cfData)), releaseTableData);
122 } 124 }
123 125
(...skipping 15 matching lines...) Expand all
139 hb_font_make_immutable(font); 141 hb_font_make_immutable(font);
140 return font; 142 return font;
141 } 143 }
142 144
143 GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float h eight) 145 GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float h eight)
144 { 146 {
145 return CGSizeMake(width, height); 147 return CGSizeMake(width, height);
146 } 148 }
147 149
148 } // namespace WebCore 150 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698