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

Side by Side Diff: core/fxge/ge/fx_ge_text.cpp

Issue 1938613003: Subtract instead of adding the negation. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nit Created 4 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 | « core/fpdfdoc/doc_vt.cpp ('k') | fpdfsdk/fxedit/fxet_edit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "core/fxcodec/include/fx_codec.h" 9 #include "core/fxcodec/include/fx_codec.h"
10 #include "core/fxge/ge/fx_text_int.h" 10 #include "core/fxge/ge/fx_text_int.h"
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 // sure |skew| != INT_MIN since -INT_MIN is undefined. 1573 // sure |skew| != INT_MIN since -INT_MIN is undefined.
1574 if (skew <= 0 && skew != std::numeric_limits<int>::min() && 1574 if (skew <= 0 && skew != std::numeric_limits<int>::min() &&
1575 static_cast<size_t>(-skew) < ANGLESKEW_ARRAY_SIZE) { 1575 static_cast<size_t>(-skew) < ANGLESKEW_ARRAY_SIZE) {
1576 skew = -g_AngleSkew[-skew]; 1576 skew = -g_AngleSkew[-skew];
1577 } else { 1577 } else {
1578 skew = -58; 1578 skew = -58;
1579 } 1579 }
1580 if (pFont->IsVertical()) 1580 if (pFont->IsVertical())
1581 ft_matrix.yx += ft_matrix.yy * skew / 100; 1581 ft_matrix.yx += ft_matrix.yy * skew / 100;
1582 else 1582 else
1583 ft_matrix.xy += -ft_matrix.xx * skew / 100; 1583 ft_matrix.xy -= ft_matrix.xx * skew / 100;
1584 } 1584 }
1585 if (pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) { 1585 if (pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
1586 pFont->AdjustMMParams(glyph_index, dest_width, 1586 pFont->AdjustMMParams(glyph_index, dest_width,
1587 pFont->GetSubstFont()->m_Weight); 1587 pFont->GetSubstFont()->m_Weight);
1588 } 1588 }
1589 } 1589 }
1590 ScopedFontTransform scoped_transform(m_Face, &ft_matrix); 1590 ScopedFontTransform scoped_transform(m_Face, &ft_matrix);
1591 int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) 1591 int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT)
1592 ? FXFT_LOAD_NO_BITMAP 1592 ? FXFT_LOAD_NO_BITMAP
1593 : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING); 1593 : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 // sure |skew| != INT_MIN since -INT_MIN is undefined. 1843 // sure |skew| != INT_MIN since -INT_MIN is undefined.
1844 if (skew <= 0 && skew != std::numeric_limits<int>::min() && 1844 if (skew <= 0 && skew != std::numeric_limits<int>::min() &&
1845 static_cast<size_t>(-skew) < ANGLESKEW_ARRAY_SIZE) { 1845 static_cast<size_t>(-skew) < ANGLESKEW_ARRAY_SIZE) {
1846 skew = -g_AngleSkew[-skew]; 1846 skew = -g_AngleSkew[-skew];
1847 } else { 1847 } else {
1848 skew = -58; 1848 skew = -58;
1849 } 1849 }
1850 if (m_bVertical) 1850 if (m_bVertical)
1851 ft_matrix.yx += ft_matrix.yy * skew / 100; 1851 ft_matrix.yx += ft_matrix.yy * skew / 100;
1852 else 1852 else
1853 ft_matrix.xy += -ft_matrix.xx * skew / 100; 1853 ft_matrix.xy -= ft_matrix.xx * skew / 100;
1854 } 1854 }
1855 if (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) { 1855 if (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
1856 AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight); 1856 AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight);
1857 } 1857 }
1858 } 1858 }
1859 ScopedFontTransform scoped_transform(m_Face, &ft_matrix); 1859 ScopedFontTransform scoped_transform(m_Face, &ft_matrix);
1860 int load_flags = FXFT_LOAD_NO_BITMAP; 1860 int load_flags = FXFT_LOAD_NO_BITMAP;
1861 if (!(m_Face->face_flags & FT_FACE_FLAG_SFNT) || !FT_IS_TRICKY(m_Face)) { 1861 if (!(m_Face->face_flags & FT_FACE_FLAG_SFNT) || !FT_IS_TRICKY(m_Face)) {
1862 load_flags |= FT_LOAD_NO_HINTING; 1862 load_flags |= FT_LOAD_NO_HINTING;
1863 } 1863 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 void _CFX_UniqueKeyGen::Generate(int count, ...) { 1907 void _CFX_UniqueKeyGen::Generate(int count, ...) {
1908 va_list argList; 1908 va_list argList;
1909 va_start(argList, count); 1909 va_start(argList, count);
1910 for (int i = 0; i < count; i++) { 1910 for (int i = 0; i < count; i++) {
1911 int p = va_arg(argList, int); 1911 int p = va_arg(argList, int);
1912 ((uint32_t*)m_Key)[i] = p; 1912 ((uint32_t*)m_Key)[i] = p;
1913 } 1913 }
1914 va_end(argList); 1914 va_end(argList);
1915 m_KeyLen = count * sizeof(uint32_t); 1915 m_KeyLen = count * sizeof(uint32_t);
1916 } 1916 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_vt.cpp ('k') | fpdfsdk/fxedit/fxet_edit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698