OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. |
3 * | 4 * |
4 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
6 * met: | 7 * met: |
7 * | 8 * |
8 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 11 * * Redistributions in binary form must reproduce the above |
11 * copyright notice, this list of conditions and the following disclaimer | 12 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 13 * in the documentation and/or other materials provided with the |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 void HarfBuzzShaper::setFontFeatures() | 502 void HarfBuzzShaper::setFontFeatures() |
502 { | 503 { |
503 const FontDescription& description = m_font->fontDescription(); | 504 const FontDescription& description = m_font->fontDescription(); |
504 if (description.orientation() == Vertical) { | 505 if (description.orientation() == Vertical) { |
505 static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<un
signed>(-1) }; | 506 static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<un
signed>(-1) }; |
506 static hb_feature_t vrt2 = { HarfBuzzFace::vrt2Tag, 1, 0, static_cast<un
signed>(-1) }; | 507 static hb_feature_t vrt2 = { HarfBuzzFace::vrt2Tag, 1, 0, static_cast<un
signed>(-1) }; |
507 m_features.append(vert); | 508 m_features.append(vert); |
508 m_features.append(vrt2); | 509 m_features.append(vrt2); |
509 } | 510 } |
510 | 511 |
| 512 static hb_feature_t noKern = { HB_TAG('k', 'e', 'r', 'n'), 0, 0, static_cast
<unsigned>(-1) }; |
| 513 static hb_feature_t noVkrn = { HB_TAG('v', 'k', 'r', 'n'), 0, 0, static_cast
<unsigned>(-1) }; |
| 514 switch (description.kerning()) { |
| 515 case FontDescription::NormalKerning: |
| 516 // kern/vkrn are enabled by default |
| 517 break; |
| 518 case FontDescription::NoneKerning: |
| 519 m_features.append(description.orientation() == Vertical ? noVkrn : noKer
n); |
| 520 break; |
| 521 case FontDescription::AutoKerning: |
| 522 break; |
| 523 } |
| 524 |
511 FontFeatureSettings* settings = description.featureSettings(); | 525 FontFeatureSettings* settings = description.featureSettings(); |
512 if (!settings) | 526 if (!settings) |
513 return; | 527 return; |
514 | 528 |
515 unsigned numFeatures = settings->size(); | 529 unsigned numFeatures = settings->size(); |
516 for (unsigned i = 0; i < numFeatures; ++i) { | 530 for (unsigned i = 0; i < numFeatures; ++i) { |
517 hb_feature_t feature; | 531 hb_feature_t feature; |
518 String tag = settings->at(i).tag(); | 532 String tag = settings->at(i).tag(); |
519 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]); | 533 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]); |
520 feature.value = settings->at(i).value(); | 534 feature.value = settings->at(i).value(); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 if (!foundToX) | 888 if (!foundToX) |
875 toX = m_run.rtl() ? 0 : m_totalWidth; | 889 toX = m_run.rtl() ? 0 : m_totalWidth; |
876 | 890 |
877 // Using floorf() and roundf() as the same as mac port. | 891 // Using floorf() and roundf() as the same as mac port. |
878 if (fromX < toX) | 892 if (fromX < toX) |
879 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); | 893 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from
X), height); |
880 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); | 894 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he
ight); |
881 } | 895 } |
882 | 896 |
883 } // namespace WebCore | 897 } // namespace WebCore |
OLD | NEW |