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

Side by Side Diff: Source/platform/fonts/mac/ComplexTextController.cpp

Issue 255323004: Rendering text-justify:distribute for 8 bit characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using enum Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) 61 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
62 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) 62 , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
63 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) 63 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
64 { 64 {
65 if (!m_expansion) 65 if (!m_expansion)
66 m_expansionPerOpportunity = 0; 66 m_expansionPerOpportunity = 0;
67 else { 67 else {
68 bool isAfterExpansion = m_afterExpansion; 68 bool isAfterExpansion = m_afterExpansion;
69 unsigned expansionOpportunityCount; 69 unsigned expansionOpportunityCount;
70 if (m_run.is8Bit()) 70 if (m_run.is8Bit())
71 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters8(), m_end, m_run.direction(), isAfterExpansion); 71 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters8(), m_end, m_run.direction(), isAfterExpansion, m_run.textJustify( ));
72 else 72 else
73 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters16(), m_end, m_run.direction(), isAfterExpansion); 73 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters16(), m_end, m_run.direction(), isAfterExpansion, m_run.textJustify ());
74 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 74 if (isAfterExpansion && !m_run.allowsTrailingExpansion())
75 expansionOpportunityCount--; 75 expansionOpportunityCount--;
76 76
77 if (!expansionOpportunityCount) 77 if (!expansionOpportunityCount)
78 m_expansionPerOpportunity = 0; 78 m_expansionPerOpportunity = 0;
79 else 79 else
80 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; 80 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
81 } 81 }
82 82
83 collectComplexTextRuns(); 83 collectComplexTextRuns();
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 607
608 lastCharacterIndex = characterIndex; 608 lastCharacterIndex = characterIndex;
609 } 609 }
610 if (!isMonotonic) 610 if (!isMonotonic)
611 complexTextRun.setIsNonMonotonic(); 611 complexTextRun.setIsNonMonotonic();
612 } 612 }
613 m_totalWidth += widthSinceLastCommit; 613 m_totalWidth += widthSinceLastCommit;
614 } 614 }
615 615
616 } // namespace blink 616 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698