Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 263363005: Initial patch for FontVariant, variant like HalfWidth should take Complex Path (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@emoji_android
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 case FontDescription::DisabledLigaturesState: 510 case FontDescription::DisabledLigaturesState:
511 m_features.append(noCalt); 511 m_features.append(noCalt);
512 break; 512 break;
513 case FontDescription::EnabledLigaturesState: 513 case FontDescription::EnabledLigaturesState:
514 // calt is on by default 514 // calt is on by default
515 break; 515 break;
516 case FontDescription::NormalLigaturesState: 516 case FontDescription::NormalLigaturesState:
517 break; 517 break;
518 } 518 }
519 519
520 static hb_feature_t hwid = { HB_TAG('h', 'w', 'i', 'd'), 1, 0, static_cast<u nsigned>(-1) };
521 static hb_feature_t twid = { HB_TAG('t', 'w', 'i', 'd'), 1, 0, static_cast<u nsigned>(-1) };
522 static hb_feature_t qwid = { HB_TAG('d', 'w', 'i', 'd'), 1, 0, static_cast<u nsigned>(-1) };
523 switch (description.widthVariant()) {
524 case HalfWidth:
525 m_features.append(hwid);
526 break;
527 case ThirdWidth:
528 m_features.append(twid);
529 break;
530 case QuarterWidth:
531 m_features.append(qwid);
532 break;
533 case RegularWidth:
534 // to keep compiler happy
Dominik Röttsches 2014/05/09 07:52:18 Please remove this comment.
h.joshi 2014/05/09 08:48:25 Okey, will remove this in next patch On 2014/05/0
535 break;
536 }
537
520 FontFeatureSettings* settings = description.featureSettings(); 538 FontFeatureSettings* settings = description.featureSettings();
521 if (!settings) 539 if (!settings)
522 return; 540 return;
523 541
524 unsigned numFeatures = settings->size(); 542 unsigned numFeatures = settings->size();
525 for (unsigned i = 0; i < numFeatures; ++i) { 543 for (unsigned i = 0; i < numFeatures; ++i) {
526 hb_feature_t feature; 544 hb_feature_t feature;
527 const AtomicString& tag = settings->at(i).tag(); 545 const AtomicString& tag = settings->at(i).tag();
528 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]); 546 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]);
529 feature.value = settings->at(i).value(); 547 feature.value = settings->at(i).value();
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 if (!foundToX) 1128 if (!foundToX)
1111 toX = m_run.rtl() ? 0 : m_totalWidth; 1129 toX = m_run.rtl() ? 0 : m_totalWidth;
1112 1130
1113 // Using floorf() and roundf() as the same as mac port. 1131 // Using floorf() and roundf() as the same as mac port.
1114 if (fromX < toX) 1132 if (fromX < toX)
1115 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from X), height); 1133 return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - from X), height);
1116 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he ight); 1134 return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), he ight);
1117 } 1135 }
1118 1136
1119 } // namespace WebCore 1137 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698