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

Side by Side Diff: core/fxge/apple/fx_apple_platform.cpp

Issue 2445933002: Use glyph index as backup of ExtGID on Mac (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 // 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 "core/fxcrt/fx_system.h" 7 #include "core/fxcrt/fx_system.h"
8 8
9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return FALSE; 56 return FALSE;
57 57
58 pFont->SetPlatformFont( 58 pFont->SetPlatformFont(
59 quartz2d.CreateFont(pFont->GetFontData(), pFont->GetSize())); 59 quartz2d.CreateFont(pFont->GetFontData(), pFont->GetSize()));
60 if (!pFont->GetPlatformFont()) 60 if (!pFont->GetPlatformFont())
61 return FALSE; 61 return FALSE;
62 } 62 }
63 CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars); 63 CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars);
64 CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars); 64 CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
65 for (int i = 0; i < nChars; i++) { 65 for (int i = 0; i < nChars; i++) {
66 glyph_indices[i] = pCharPos[i].m_ExtGID; 66 glyph_indices[i] =
67 pCharPos[i].m_ExtGID ? pCharPos[i].m_ExtGID : pCharPos[i].m_GlyphIndex;
67 if (bNegSize) 68 if (bNegSize)
68 glyph_positions[i].x = -pCharPos[i].m_OriginX; 69 glyph_positions[i].x = -pCharPos[i].m_OriginX;
69 else 70 else
70 glyph_positions[i].x = pCharPos[i].m_OriginX; 71 glyph_positions[i].x = pCharPos[i].m_OriginX;
71 glyph_positions[i].y = pCharPos[i].m_OriginY; 72 glyph_positions[i].y = pCharPos[i].m_OriginY;
72 } 73 }
73 if (bNegSize) { 74 if (bNegSize) {
74 new_matrix.a = -new_matrix.a; 75 new_matrix.a = -new_matrix.a;
75 new_matrix.c = -new_matrix.c; 76 new_matrix.c = -new_matrix.c;
76 } else { 77 } else {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (m_pPlatformFont) { 181 if (m_pPlatformFont) {
181 CQuartz2D& quartz2d = 182 CQuartz2D& quartz2d =
182 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) 183 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData())
183 ->m_quartz2d; 184 ->m_quartz2d;
184 quartz2d.DestroyFont(m_pPlatformFont); 185 quartz2d.DestroyFont(m_pPlatformFont);
185 m_pPlatformFont = nullptr; 186 m_pPlatformFont = nullptr;
186 } 187 }
187 } 188 }
188 189
189 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 190 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698