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

Unified Diff: third_party/freetype2/src/src/base/ftgasp.c

Issue 1524973002: Update freetype sources (2.6.2) in third party. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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/freetype2/src/src/base/ftfstype.c ('k') | third_party/freetype2/src/src/base/ftgloadr.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype2/src/src/base/ftgasp.c
diff --git a/third_party/freetype2/src/src/base/ftgasp.c b/third_party/freetype2/src/src/base/ftgasp.c
new file mode 100644
index 0000000000000000000000000000000000000000..bbd257c47954084f05920fc0947519d7cc4ab51c
--- /dev/null
+++ b/third_party/freetype2/src/src/base/ftgasp.c
@@ -0,0 +1,61 @@
+/***************************************************************************/
+/* */
+/* ftgasp.c */
+/* */
+/* Access of TrueType's `gasp' table (body). */
+/* */
+/* Copyright 2007-2015 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_GASP_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+
+
+ FT_EXPORT_DEF( FT_Int )
+ FT_Get_Gasp( FT_Face face,
+ FT_UInt ppem )
+ {
+ FT_Int result = FT_GASP_NO_TABLE;
+
+
+ if ( face && FT_IS_SFNT( face ) )
+ {
+ TT_Face ttface = (TT_Face)face;
+
+
+ if ( ttface->gasp.numRanges > 0 )
+ {
+ TT_GaspRange range = ttface->gasp.gaspRanges;
+ TT_GaspRange range_end = range + ttface->gasp.numRanges;
+
+
+ while ( ppem > range->maxPPEM )
+ {
+ range++;
+ if ( range >= range_end )
+ goto Exit;
+ }
+
+ result = range->gaspFlag;
+
+ /* ensure that we don't have spurious bits */
+ if ( ttface->gasp.version == 0 )
+ result &= 3;
+ }
+ }
+ Exit:
+ return result;
+ }
+
+
+/* END */
« no previous file with comments | « third_party/freetype2/src/src/base/ftfstype.c ('k') | third_party/freetype2/src/src/base/ftgloadr.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698