OLD | NEW |
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 "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 #include "text_int.h" | 10 #include "text_int.h" |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536; | 1366 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536; |
1367 } else { | 1367 } else { |
1368 coords[0] = weight; | 1368 coords[0] = weight; |
1369 } | 1369 } |
1370 if (dest_width == 0) { | 1370 if (dest_width == 0) { |
1371 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; | 1371 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; |
1372 } else { | 1372 } else { |
1373 int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; | 1373 int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; |
1374 int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; | 1374 int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; |
1375 coords[1] = min_param; | 1375 coords[1] = min_param; |
1376 int error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); | 1376 (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); |
1377 error = FXFT_Load_Glyph( | 1377 (void)FXFT_Load_Glyph( |
1378 m_Face, glyph_index, | 1378 m_Face, glyph_index, |
1379 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); | 1379 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); |
1380 int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / | 1380 int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / |
1381 FXFT_Get_Face_UnitsPerEM(m_Face); | 1381 FXFT_Get_Face_UnitsPerEM(m_Face); |
1382 coords[1] = max_param; | 1382 coords[1] = max_param; |
1383 error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); | 1383 (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); |
1384 error = FXFT_Load_Glyph( | 1384 (void)FXFT_Load_Glyph( |
1385 m_Face, glyph_index, | 1385 m_Face, glyph_index, |
1386 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); | 1386 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); |
1387 int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / | 1387 int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / |
1388 FXFT_Get_Face_UnitsPerEM(m_Face); | 1388 FXFT_Get_Face_UnitsPerEM(m_Face); |
1389 if (max_width == min_width) { | 1389 if (max_width == min_width) { |
| 1390 FXFT_Free(m_Face, pMasters); |
1390 return; | 1391 return; |
1391 } | 1392 } |
1392 int param = min_param + | 1393 int param = min_param + |
1393 (max_param - min_param) * (dest_width - min_width) / | 1394 (max_param - min_param) * (dest_width - min_width) / |
1394 (max_width - min_width); | 1395 (max_width - min_width); |
1395 coords[1] = param; | 1396 coords[1] = param; |
1396 } | 1397 } |
1397 FXFT_Free(m_Face, pMasters); | 1398 FXFT_Free(m_Face, pMasters); |
1398 FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); | 1399 FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); |
1399 } | 1400 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 void _CFX_UniqueKeyGen::Generate(int count, ...) { | 1843 void _CFX_UniqueKeyGen::Generate(int count, ...) { |
1843 va_list argList; | 1844 va_list argList; |
1844 va_start(argList, count); | 1845 va_start(argList, count); |
1845 for (int i = 0; i < count; i++) { | 1846 for (int i = 0; i < count; i++) { |
1846 int p = va_arg(argList, int); | 1847 int p = va_arg(argList, int); |
1847 ((FX_DWORD*)m_Key)[i] = p; | 1848 ((FX_DWORD*)m_Key)[i] = p; |
1848 } | 1849 } |
1849 va_end(argList); | 1850 va_end(argList); |
1850 m_KeyLen = count * sizeof(FX_DWORD); | 1851 m_KeyLen = count * sizeof(FX_DWORD); |
1851 } | 1852 } |
OLD | NEW |