Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / fonts / harfbuzz / HarfBuzzFaceCoreText.cpp
index afa7310..44257c8 100644 (file)
@@ -38,7 +38,7 @@
 #include <ApplicationServices/ApplicationServices.h>
 #include "hb.h"
 
-namespace WebCore {
+namespace blink {
 
 static hb_position_t floatToHarfBuzzPosition(CGFloat value)
 {
@@ -109,6 +109,8 @@ static void releaseTableData(void* userData)
 static hb_blob_t* harfBuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
 {
     CGFontRef cgFont = reinterpret_cast<CGFontRef>(userData);
+    if (!cgFont)
+        return 0;
     CFDataRef cfData = CGFontCopyTableForTag(cgFont, tag);
     if (!cfData)
         return 0;
@@ -133,7 +135,7 @@ hb_font_t* HarfBuzzFace::createFont()
 {
     hb_font_t* font = hb_font_create(m_face);
     hb_font_set_funcs(font, harfBuzzCoreTextGetFontFuncs(), m_platformData, 0);
-    const float size = m_platformData->m_size;
+    const float size = m_platformData->m_textSize;
     hb_font_set_ppem(font, size, size);
     const int scale = (1 << 16) * static_cast<int>(size);
     hb_font_set_scale(font, scale, scale);
@@ -141,4 +143,4 @@ hb_font_t* HarfBuzzFace::createFont()
     return font;
 }
 
-} // namespace WebCore
+} // namespace blink