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

Unified Diff: third_party/freetype/src/cff/cffobjs.c

Issue 815103002: Update freetype to 2.5.4. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Adjust GYP and GN Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/freetype/src/cff/cffobjs.h ('k') | third_party/freetype/src/cff/cffparse.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype/src/cff/cffobjs.c
diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cffobjs.c b/third_party/freetype/src/cff/cffobjs.c
similarity index 95%
rename from core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cffobjs.c
rename to third_party/freetype/src/cff/cffobjs.c
index b0ec7423b85d28ba94dca5ee731f981364cd6872..da3d0190fe49890e90ad1564d5e65501c319aa0d 100644
--- a/core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cffobjs.c
+++ b/third_party/freetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
-/* Copyright 1996-2013 by */
+/* Copyright 1996-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -16,16 +16,16 @@
/***************************************************************************/
-#include "../../include/ft2build.h"
+#include <ft2build.h>
-#include "../../include/freetype/internal/ftdebug.h"
-#include "../../include/freetype/internal/ftcalc.h"
-#include "../../include/freetype/internal/ftstream.h"
-#include "../../include/freetype/fterrors.h"
-#include "../../include/freetype/ttnameid.h"
-#include "../../include/freetype/tttags.h"
-#include "../../include/freetype/internal/sfnt.h"
-#include "../../include/freetype/ftcffdrv.h"
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_STREAM_H
+#include FT_ERRORS_H
+#include FT_TRUETYPE_IDS_H
+#include FT_TRUETYPE_TAGS_H
+#include FT_INTERNAL_SFNT_H
+#include FT_CFF_DRIVER_H
#include "cffobjs.h"
#include "cffload.h"
@@ -519,8 +519,7 @@
error = sfnt->init_face( stream, face, face_index, num_params, params );
if ( !error )
{
- if ( face->format_tag != TTAG_OTTO &&
- face->format_tag != 0x00010000UL ) /* `OTTO'; OpenType/CFF font */
+ if ( face->format_tag != TTAG_OTTO ) /* `OTTO'; OpenType/CFF font */
{
FT_TRACE2(( " not an OpenType/CFF font\n" ));
error = FT_THROW( Unknown_File_Format );
@@ -867,7 +866,7 @@
flags |= FT_FACE_FLAG_KERNING;
#endif
- cffface->face_flags = flags;
+ cffface->face_flags |= flags;
/*******************************************************************/
/* */
@@ -895,10 +894,6 @@
!ft_strncmp( cffface->style_name, "Black", 5 ) )
flags |= FT_STYLE_FLAG_BOLD;
- if ( !(flags & FT_STYLE_FLAG_ITALIC) && cffface->style_name )
- if ( !ft_strncmp( cffface->style_name, "Italic", 6 ) )
- flags |= FT_STYLE_FLAG_ITALIC;
-
cffface->style_flags = flags;
}
@@ -948,16 +943,6 @@
if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
goto Exit;
-#ifdef FT_MAX_CHARMAP_CACHEABLE
- if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE )
- {
- FT_ERROR(( "cff_face_init: no Unicode cmap is found, "
- "and too many subtables (%d) to add synthesized cmap\n",
- nn ));
- goto Exit;
- }
-#endif
-
/* we didn't find a Unicode charmap -- synthesize one */
cmaprec.face = cffface;
cmaprec.platform_id = TT_PLATFORM_MICROSOFT;
@@ -978,15 +963,6 @@
cffface->charmap = cffface->charmaps[nn];
Skip_Unicode:
-#ifdef FT_MAX_CHARMAP_CACHEABLE
- if ( nn > FT_MAX_CHARMAP_CACHEABLE )
- {
- FT_ERROR(( "cff_face_init: Unicode cmap is found, "
- "but too many preceding subtables (%d) to access\n",
- nn - 1 ));
- goto Exit;
- }
-#endif
if ( encoding->count > 0 )
{
FT_CMap_Class clazz;
@@ -1060,14 +1036,24 @@
CFF_Driver driver = (CFF_Driver)module;
- /* set default property values */
+ /* set default property values, cf. `ftcffdrv.h' */
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
+ driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
#else
- driver->hinting_engine = FT_CFF_HINTING_ADOBE;
+ driver->hinting_engine = FT_CFF_HINTING_ADOBE;
#endif
+
driver->no_stem_darkening = FALSE;
+ driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;
+ driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;
+ driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;
+ driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;
+ driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;
+ driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;
+ driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
+ driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
+
return FT_Err_Ok;
}
« no previous file with comments | « third_party/freetype/src/cff/cffobjs.h ('k') | third_party/freetype/src/cff/cffparse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698