| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 2009, 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 for (int i = 0; i < shaping.glyphLength(); i++, destIndex++) { | 211 for (int i = 0; i < shaping.glyphLength(); i++, destIndex++) { |
| 212 memcpy(&visualAttributes[destIndex], &shaping.m_visualAttributes[i], | 212 memcpy(&visualAttributes[destIndex], &shaping.m_visualAttributes[i], |
| 213 sizeof(SCRIPT_VISATTR)); | 213 sizeof(SCRIPT_VISATTR)); |
| 214 advances[destIndex] = shaping.m_advance[i]; | 214 advances[destIndex] = shaping.m_advance[i]; |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 | 217 |
| 218 // The documentation for Scriptjustify is wrong, the parameter is the space | 218 // The documentation for Scriptjustify is wrong, the parameter is the space |
| 219 // to add and not the width of the column you want. | 219 // to add and not the width of the column you want. |
| 220 const int minKashida = 1; // How do we decide what this should be? | 220 int minKashida; |
| 221 #if USE(SKIA_TEXT) |
| 222 // Disable kashida justification based on |
| 223 // http://blogs.msdn.com/b/michkap/archive/2010/08/31/10056140.aspx. |
| 224 for (int i = 0; i < totalGlyphs; ++i) { |
| 225 if (visualAttributes[i].uJustification == SCRIPT_JUSTIFY_ARABIC_KASHIDA) |
| 226 visualAttributes[i].uJustification = SCRIPT_JUSTIFY_NONE; |
| 227 } |
| 228 minKashida = 0; |
| 229 #else |
| 230 minKashida = 1; // How do we decide what this should be? |
| 231 #endif |
| 221 ScriptJustify(&visualAttributes[0], &advances[0], totalGlyphs, | 232 ScriptJustify(&visualAttributes[0], &advances[0], totalGlyphs, |
| 222 additionalSpace, minKashida, &justify[0]); | 233 additionalSpace, minKashida, &justify[0]); |
| 223 | 234 |
| 224 // Now we have to unpack the justification amounts back into the runs so | 235 // Now we have to unpack the justification amounts back into the runs so |
| 225 // the glyph indices match. | 236 // the glyph indices match. |
| 226 int globalGlyphIndex = 0; | 237 int globalGlyphIndex = 0; |
| 227 for (size_t run = 0; run < m_runs.size(); run++) { | 238 for (size_t run = 0; run < m_runs.size(); run++) { |
| 228 int runIndex = m_screenOrder[run]; | 239 int runIndex = m_screenOrder[run]; |
| 229 Shaping& shaping = m_shapes[runIndex]; | 240 Shaping& shaping = m_shapes[runIndex]; |
| 230 | 241 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 m_featureRecords.resize(featureSettings->size()); | 1073 m_featureRecords.resize(featureSettings->size()); |
| 1063 for (unsigned i = 0; i < featureSettings->size(); ++i) { | 1074 for (unsigned i = 0; i < featureSettings->size(); ++i) { |
| 1064 m_featureRecords[i].lParameter = featureSettings->at(i).value(); | 1075 m_featureRecords[i].lParameter = featureSettings->at(i).value(); |
| 1065 m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i
).tag()); | 1076 m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i
).tag()); |
| 1066 } | 1077 } |
| 1067 m_rangeProperties.potfRecords = &m_featureRecords[0]; | 1078 m_rangeProperties.potfRecords = &m_featureRecords[0]; |
| 1068 m_rangeProperties.cotfRecords = m_featureRecords.size(); | 1079 m_rangeProperties.cotfRecords = m_featureRecords.size(); |
| 1069 } | 1080 } |
| 1070 | 1081 |
| 1071 } // namespace WebCore | 1082 } // namespace WebCore |
| OLD | NEW |