| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 m_currentTextFragment.transform.rotate(angle); | 516 m_currentTextFragment.transform.rotate(angle); |
| 517 | 517 |
| 518 if (textPathShiftX || textPathShiftY) | 518 if (textPathShiftX || textPathShiftY) |
| 519 m_currentTextFragment.transform.translate(textPathShiftX, textPa
thShiftY); | 519 m_currentTextFragment.transform.translate(textPathShiftX, textPa
thShiftY); |
| 520 | 520 |
| 521 // In vertical text, always rotate by 90 degrees regardless of fontO
rientation. | 521 // In vertical text, always rotate by 90 degrees regardless of fontO
rientation. |
| 522 // Shaping engine takes care of the necessary orientation. | 522 // Shaping engine takes care of the necessary orientation. |
| 523 if (m_isVerticalText) | 523 if (m_isVerticalText) |
| 524 m_currentTextFragment.transform.rotate(90); | 524 m_currentTextFragment.transform.rotate(90); |
| 525 | 525 |
| 526 m_currentTextFragment.isVertical = m_isVerticalText; |
| 526 m_currentTextFragment.isTextOnPath = m_inPathLayout && m_textPathSca
ling != 1; | 527 m_currentTextFragment.isTextOnPath = m_inPathLayout && m_textPathSca
ling != 1; |
| 527 if (m_currentTextFragment.isTextOnPath) { | 528 if (m_currentTextFragment.isTextOnPath) |
| 528 if (m_isVerticalText) | 529 m_currentTextFragment.lengthAdjustScale = m_textPathScaling; |
| 529 m_currentTextFragment.lengthAdjustTransform.scaleNonUniform(
1, m_textPathScaling); | |
| 530 else | |
| 531 m_currentTextFragment.lengthAdjustTransform.scaleNonUniform(
m_textPathScaling, 1); | |
| 532 } | |
| 533 } | 530 } |
| 534 | 531 |
| 535 // Update current text position, after processing of the current charact
er finished. | 532 // Update current text position, after processing of the current charact
er finished. |
| 536 if (m_inPathLayout) { | 533 if (m_inPathLayout) { |
| 537 updateCurrentTextPosition(x, y, glyphAdvance); | 534 updateCurrentTextPosition(x, y, glyphAdvance); |
| 538 } else { | 535 } else { |
| 539 // Apply CSS 'kerning', 'letter-spacing' and 'word-spacing' to next
character, if needed. | 536 // Apply CSS 'kerning', 'letter-spacing' and 'word-spacing' to next
character, if needed. |
| 540 if (spacing) | 537 if (spacing) |
| 541 applySpacingToNextCharacter = true; | 538 applySpacingToNextCharacter = true; |
| 542 | 539 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 557 } | 554 } |
| 558 | 555 |
| 559 if (!didStartTextFragment) | 556 if (!didStartTextFragment) |
| 560 return; | 557 return; |
| 561 | 558 |
| 562 // Close last open fragment, if needed. | 559 // Close last open fragment, if needed. |
| 563 recordTextFragment(textBox); | 560 recordTextFragment(textBox); |
| 564 } | 561 } |
| 565 | 562 |
| 566 } | 563 } |
| OLD | NEW |