| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Holger Hans Peter Freyther | 3 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #include "config.h" | 22 #include "config.h" |
| 23 #include "core/platform/graphics/WidthIterator.h" | 23 #include "core/platform/graphics/WidthIterator.h" |
| 24 | 24 |
| 25 #include "core/platform/graphics/Font.h" | 25 #include "core/platform/graphics/Font.h" |
| 26 #include "core/platform/graphics/GlyphBuffer.h" | |
| 27 #include "core/platform/graphics/Latin1TextIterator.h" | |
| 28 #include "core/platform/graphics/SimpleFontData.h" | 26 #include "core/platform/graphics/SimpleFontData.h" |
| 27 #include "platform/fonts/GlyphBuffer.h" |
| 28 #include "platform/fonts/Latin1TextIterator.h" |
| 29 #include "platform/text/SurrogatePairAwareTextIterator.h" | 29 #include "platform/text/SurrogatePairAwareTextIterator.h" |
| 30 #include "wtf/MathExtras.h" | 30 #include "wtf/MathExtras.h" |
| 31 | 31 |
| 32 using namespace WTF; | 32 using namespace WTF; |
| 33 using namespace Unicode; | 33 using namespace Unicode; |
| 34 using namespace std; | 34 using namespace std; |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const
SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphas
is) | 38 WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const
SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphas
is) |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 int oldSize = glyphBuffer.size(); | 338 int oldSize = glyphBuffer.size(); |
| 339 advance(m_currentCharacter + 1, &glyphBuffer); | 339 advance(m_currentCharacter + 1, &glyphBuffer); |
| 340 float w = 0; | 340 float w = 0; |
| 341 for (int i = oldSize; i < glyphBuffer.size(); ++i) | 341 for (int i = oldSize; i < glyphBuffer.size(); ++i) |
| 342 w += glyphBuffer.advanceAt(i); | 342 w += glyphBuffer.advanceAt(i); |
| 343 width = w; | 343 width = w; |
| 344 return glyphBuffer.size() > oldSize; | 344 return glyphBuffer.size() > oldSize; |
| 345 } | 345 } |
| 346 | 346 |
| 347 } | 347 } |
| OLD | NEW |