From 2334660053e044ca79a1831a6c73f69891f039e0 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 30 Jan 2018 21:42:41 +0000 Subject: Use unsigned for char width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 806612 Change-Id: I22bd9046dd37a1b596762c46a6b29a323d6e9fa1 Reviewed-on: https://pdfium-review.googlesource.com/24410 Reviewed-by: dsinclair Commit-Queue: Nicolás Peña Moreno --- core/fxge/cfx_font.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/fxge/cfx_font.cpp') diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index 6d969a345c..ece3f96bed 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -295,7 +295,7 @@ bool CFX_Font::LoadFile(const RetainPtr& pFile, } #endif // PDF_ENABLE_XFA -int CFX_Font::GetGlyphWidth(uint32_t glyph_index) { +uint32_t CFX_Font::GetGlyphWidth(uint32_t glyph_index) { if (!m_Face) return 0; if (m_pSubstFont && m_pSubstFont->m_bFlagMM) @@ -307,7 +307,7 @@ int CFX_Font::GetGlyphWidth(uint32_t glyph_index) { return 0; int horiAdvance = FXFT_Get_Glyph_HoriAdvance(m_Face); - if (horiAdvance < kThousandthMinInt || horiAdvance > kThousandthMaxInt) + if (horiAdvance < 0 || horiAdvance > kThousandthMaxInt) return 0; return EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), horiAdvance); @@ -501,7 +501,7 @@ void CFX_Font::ClearFaceCache() { } void CFX_Font::AdjustMMParams(int glyph_index, - int dest_width, + uint32_t dest_width, int weight) const { FXFT_MM_Var pMasters = nullptr; FXFT_Get_MM_Var(m_Face, &pMasters); @@ -544,7 +544,7 @@ void CFX_Font::AdjustMMParams(int glyph_index, } CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index, - int dest_width) const { + uint32_t dest_width) const { if (!m_Face) return nullptr; FXFT_Set_Pixel_Sizes(m_Face, 0, 64); @@ -613,7 +613,7 @@ CFX_PathData* CFX_Font::LoadGlyphPathImpl(uint32_t glyph_index, const CFX_GlyphBitmap* CFX_Font::LoadGlyphBitmap(uint32_t glyph_index, bool bFontStyle, const CFX_Matrix* pMatrix, - int dest_width, + uint32_t dest_width, int anti_alias, int& text_flags) const { return GetFaceCache()->LoadGlyphBitmap(this, glyph_index, bFontStyle, pMatrix, @@ -621,7 +621,7 @@ const CFX_GlyphBitmap* CFX_Font::LoadGlyphBitmap(uint32_t glyph_index, } const CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, - int dest_width) const { + uint32_t dest_width) const { return GetFaceCache()->LoadGlyphPath(this, glyph_index, dest_width); } -- cgit v1.2.3