| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // OrientationIterator::OrientationKeep, | 93 // OrientationIterator::OrientationKeep, |
| 94 // SmallCapsIterator::SmallCapsSameCase | 94 // SmallCapsIterator::SmallCapsSameCase |
| 95 // | 95 // |
| 96 // | 96 // |
| 97 // Let's assume the CSS for this text run is as follows: | 97 // Let's assume the CSS for this text run is as follows: |
| 98 // font-family: "Heiti SC", Tinos, sans-serif; | 98 // font-family: "Heiti SC", Tinos, sans-serif; |
| 99 // where Tinos is a web font, defined as a composite font, with two sub ranges, | 99 // where Tinos is a web font, defined as a composite font, with two sub ranges, |
| 100 // one for Latin U+00-U+FF and one unrestricted unicode-range. | 100 // one for Latin U+00-U+FF and one unrestricted unicode-range. |
| 101 // | 101 // |
| 102 // FontFallbackIterator provides the shaper with Heiti SC, then Tinos of the | 102 // FontFallbackIterator provides the shaper with Heiti SC, then Tinos of the |
| 103 // restricted unicode-range, then the unrestricted full unicode-range Tinos, the
n | 103 // restricted unicode-range, then the unrestricted full unicode-range Tinos, |
| 104 // a system sans-serif. | 104 // then a system sans-serif. |
| 105 // | 105 // |
| 106 // The initial segment 0-2 to the shaper, together with the segmentation | 106 // The initial segment 0-2 to the shaper, together with the segmentation |
| 107 // properties and the initial Heiti SC font. Characters 0-2 are shaped | 107 // properties and the initial Heiti SC font. Characters 0-2 are shaped |
| 108 // successfully with Heiti SC. The next segment, 3-5 is passed to the shaper. Th
e | 108 // successfully with Heiti SC. The next segment, 3-5 is passed to the shaper. |
| 109 // shaper attempts to shape it with Heiti SC, which fails for the Combining | 109 // The shaper attempts to shape it with Heiti SC, which fails for the Combining |
| 110 // Macron. So the shaping result for this segment would look similar to this. | 110 // Macron. So the shaping result for this segment would look similar to this. |
| 111 // | 111 // |
| 112 // Glyphpos: 0 1 2 3 | 112 // Glyphpos: 0 1 2 3 |
| 113 // Cluster: 0 0 2 3 | 113 // Cluster: 0 0 2 3 |
| 114 // Glyph: a x a A (where x is .notdef) | 114 // Glyph: a x a A (where x is .notdef) |
| 115 // | 115 // |
| 116 // Now in the extractShapeResults() step we notice that there is more work to do
, | 116 // Now in the extractShapeResults() step we notice that there is more work to |
| 117 // since Heiti SC does not have a glyph for the Combining Macron combined with a
n | 117 // do, since Heiti SC does not have a glyph for the Combining Macron combined |
| 118 // a. So, this cluster together with a Todo item for switching to the next font | 118 // with an a. So, this cluster together with a Todo item for switching to the |
| 119 // is put into HolesQueue. | 119 // next font is put into HolesQueue. |
| 120 // | 120 // |
| 121 // After shaping the initial segment, the remaining items in the HolesQueue are | 121 // After shaping the initial segment, the remaining items in the HolesQueue are |
| 122 // processed, picking them from the head of the queue. So, first, the next font | 122 // processed, picking them from the head of the queue. So, first, the next font |
| 123 // is requested from the FontFallbackIterator. In this case, Tinos (for the rang
e | 123 // is requested from the FontFallbackIterator. In this case, Tinos (for the |
| 124 // U+00-U+FF) comes back. Shaping using this font, assuming it is subsetted, | 124 // range U+00-U+FF) comes back. Shaping using this font, assuming it is |
| 125 // fails again since there is no combining mark available. This triggers | 125 // subsetted, fails again since there is no combining mark available. This |
| 126 // requesting yet another font. This time, the Tinos font for the full | 126 // triggers requesting yet another font. This time, the Tinos font for the full |
| 127 // range. With this, shaping succeeds with the following HarfBuzz result: | 127 // range. With this, shaping succeeds with the following HarfBuzz result: |
| 128 // | 128 // |
| 129 // Glyphpos 0 1 2 3 | 129 // Glyphpos 0 1 2 3 |
| 130 // Cluster: 0 0 2 3 | 130 // Cluster: 0 0 2 3 |
| 131 // Glyph: a ̄ a A (with glyph coordinates placing the ̄ above the first a) | 131 // Glyph: a ̄ a A (with glyph coordinates placing the ̄ above the first a) |
| 132 // | 132 // |
| 133 // Now this sub run is successfully processed and can be appended to | 133 // Now this sub run is successfully processed and can be appended to |
| 134 // ShapeResult. A new ShapeResult::RunInfo is created. The logic in | 134 // ShapeResult. A new ShapeResult::RunInfo is created. The logic in |
| 135 // insertRunIntoShapeResult then takes care of merging the shape result into | 135 // insertRunIntoShapeResult then takes care of merging the shape result into |
| 136 // the right position the vector of RunInfos in ShapeResult. | 136 // the right position the vector of RunInfos in ShapeResult. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 std::unique_ptr<UChar[]> m_normalizedBuffer; | 210 std::unique_ptr<UChar[]> m_normalizedBuffer; |
| 211 unsigned m_normalizedBufferLength; | 211 unsigned m_normalizedBufferLength; |
| 212 | 212 |
| 213 FeaturesVector m_features; | 213 FeaturesVector m_features; |
| 214 Deque<HolesQueueItem> m_holesQueue; | 214 Deque<HolesQueueItem> m_holesQueue; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace blink | 217 } // namespace blink |
| 218 | 218 |
| 219 #endif // HarfBuzzShaper_h | 219 #endif // HarfBuzzShaper_h |
| OLD | NEW |