| OLD | NEW |
| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection) | 316 bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection) |
| 317 { | 317 { |
| 318 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_
destroy); | 318 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_
destroy); |
| 319 | 319 |
| 320 hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs()
); | 320 hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs()
); |
| 321 | 321 |
| 322 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { | 322 for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { |
| 323 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i; | 323 unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i; |
| 324 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); | 324 HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); |
| 325 const SimpleFontData* currentFontData = currentRun->fontData(); | 325 const SimpleFontData* currentFontData = currentRun->fontData(); |
| 326 if (currentFontData->isSVGFont()) |
| 327 return false; |
| 326 | 328 |
| 327 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); | 329 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); |
| 328 if (shouldSetDirection) | 330 if (shouldSetDirection) |
| 329 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB
_DIRECTION_RTL : HB_DIRECTION_LTR); | 331 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB
_DIRECTION_RTL : HB_DIRECTION_LTR); |
| 330 | 332 |
| 331 // Add a space as pre-context to the buffer. This prevents showing dotte
d-circle | 333 // Add a space as pre-context to the buffer. This prevents showing dotte
d-circle |
| 332 // for combining marks at the beginning of runs. | 334 // for combining marks at the beginning of runs. |
| 333 static const uint16_t preContext = ' '; | 335 static const uint16_t preContext = ' '; |
| 334 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0); | 336 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0); |
| 335 | 337 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 if (!foundToX) | 536 if (!foundToX) |
| 535 toX = m_run.rtl() ? 0 : m_totalWidth; | 537 toX = m_run.rtl() ? 0 : m_totalWidth; |
| 536 | 538 |
| 537 // Using floorf() and roundf() as the same as mac port. | 539 // Using floorf() and roundf() as the same as mac port. |
| 538 if (fromX < toX) | 540 if (fromX < toX) |
| 539 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); | 541 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); |
| 540 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); | 542 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); |
| 541 } | 543 } |
| 542 | 544 |
| 543 } // namespace WebCore | 545 } // namespace WebCore |
| OLD | NEW |