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

Side by Side Diff: core/src/fxge/ge/fx_ge_font.cpp

Issue 1379093003: Merge to XFA: Turn a couple functions that always return true to return void. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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/src/fpdftext/text_int.h ('k') | xfa/src/fgas/src/font/fx_gefont.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 "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxge/fx_freetype.h" 8 #include "../../../include/fxge/fx_freetype.h"
9 #include "text_int.h" 9 #include "text_int.h"
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 FX_Free(m_pGsubData); 109 FX_Free(m_pGsubData);
110 m_pGsubData = NULL; 110 m_pGsubData = NULL;
111 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 111 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
112 ReleasePlatformResource(); 112 ReleasePlatformResource();
113 #endif 113 #endif
114 } 114 }
115 void CFX_Font::DeleteFace() { 115 void CFX_Font::DeleteFace() {
116 FXFT_Done_Face(m_Face); 116 FXFT_Done_Face(m_Face);
117 m_Face = NULL; 117 m_Face = NULL;
118 } 118 }
119 FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, 119 void CFX_Font::LoadSubst(const CFX_ByteString& face_name,
120 FX_BOOL bTrueType, 120 FX_BOOL bTrueType,
121 FX_DWORD flags, 121 FX_DWORD flags,
122 int weight, 122 int weight,
123 int italic_angle, 123 int italic_angle,
124 int CharsetCP, 124 int CharsetCP,
125 FX_BOOL bVertical) { 125 FX_BOOL bVertical) {
126 m_bEmbedded = FALSE; 126 m_bEmbedded = FALSE;
127 m_bVertical = bVertical; 127 m_bVertical = bVertical;
128 m_pSubstFont = new CFX_SubstFont; 128 m_pSubstFont = new CFX_SubstFont;
129 m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont( 129 m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(
130 face_name, bTrueType, flags, weight, italic_angle, CharsetCP, 130 face_name, bTrueType, flags, weight, italic_angle, CharsetCP,
131 m_pSubstFont); 131 m_pSubstFont);
132 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 132 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
133 if (m_pSubstFont->m_ExtHandle) { 133 if (m_pSubstFont->m_ExtHandle) {
134 m_pPlatformFont = m_pSubstFont->m_ExtHandle; 134 m_pPlatformFont = m_pSubstFont->m_ExtHandle;
135 m_pSubstFont->m_ExtHandle = NULL; 135 m_pSubstFont->m_ExtHandle = NULL;
136 } 136 }
137 #endif 137 #endif
138 if (m_Face) { 138 if (m_Face) {
139 m_pFontData = FXFT_Get_Face_Stream_Base(m_Face); 139 m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
140 m_dwSize = FXFT_Get_Face_Stream_Size(m_Face); 140 m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
141 } 141 }
142 return TRUE;
143 } 142 }
144 extern "C" { 143 extern "C" {
145 unsigned long _FTStreamRead(FXFT_Stream stream, 144 unsigned long _FTStreamRead(FXFT_Stream stream,
146 unsigned long offset, 145 unsigned long offset,
147 unsigned char* buffer, 146 unsigned char* buffer,
148 unsigned long count) { 147 unsigned long count) {
149 if (count == 0) { 148 if (count == 0) {
150 return 0; 149 return 0;
151 } 150 }
152 IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer; 151 IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 532
534 for (size_t i = 0; i < FX_ArraySize(g_EncodingID); ++i) { 533 for (size_t i = 0; i < FX_ArraySize(g_EncodingID); ++i) {
535 CFX_UnicodeEncodingEx* pFontEncoding = 534 CFX_UnicodeEncodingEx* pFontEncoding =
536 _FXFM_CreateFontEncoding(pFont, g_EncodingID[i]); 535 _FXFM_CreateFontEncoding(pFont, g_EncodingID[i]);
537 if (pFontEncoding) { 536 if (pFontEncoding) {
538 return pFontEncoding; 537 return pFontEncoding;
539 } 538 }
540 } 539 }
541 return NULL; 540 return NULL;
542 } 541 }
OLDNEW
« no previous file with comments | « core/src/fpdftext/text_int.h ('k') | xfa/src/fgas/src/font/fx_gefont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698