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

Side by Side Diff: Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 820
821 HarfBuzzRunCache& runCache = harfBuzzRunCache(); 821 HarfBuzzRunCache& runCache = harfBuzzRunCache();
822 const FontDescription& fontDescription = m_font->fontDescription(); 822 const FontDescription& fontDescription = m_font->fontDescription();
823 const String& localeString = fontDescription.locale(); 823 const String& localeString = fontDescription.locale();
824 CString locale = localeString.latin1(); 824 CString locale = localeString.latin1();
825 825
826 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { 826 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
827 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i; 827 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i;
828 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); 828 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
829 const SimpleFontData* currentFontData = currentRun->fontData(); 829 const SimpleFontData* currentFontData = currentRun->fontData();
830 if (currentFontData->isSVGFont())
831 return false;
832 830
833 FontPlatformData* platformData = const_cast<FontPlatformData*>(&currentF ontData->platformData()); 831 FontPlatformData* platformData = const_cast<FontPlatformData*>(&currentF ontData->platformData());
834 HarfBuzzFace* face = platformData->harfBuzzFace(); 832 HarfBuzzFace* face = platformData->harfBuzzFace();
835 if (!face) 833 if (!face)
836 return false; 834 return false;
837 835
838 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc ale.data(), locale.length())); 836 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc ale.data(), locale.length()));
839 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); 837 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
840 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction()); 838 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction());
841 839
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 fromX = 0; 1144 fromX = 0;
1147 if (!foundToX) 1145 if (!foundToX)
1148 toX = m_run.rtl() ? 0 : m_totalWidth; 1146 toX = m_run.rtl() ? 0 : m_totalWidth;
1149 1147
1150 if (fromX < toX) 1148 if (fromX < toX)
1151 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); 1149 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height);
1152 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); 1150 return FloatRect(point.x() + toX, point.y(), fromX - toX, height);
1153 } 1151 }
1154 1152
1155 } // namespace blink 1153 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698