summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2014-12-03 10:18:34 +0100
committerWerner Lemberg <wl@gnu.org>2014-12-03 10:18:34 +0100
commit16188ebfac8f179bfeb32a6a3147b4264516bc79 (patch)
treeabc21b4f3580646580eba18e50ec43e3ae350d41
parent16dc5d0b04fa1a67397e936fe7fcf700a732c102 (diff)
downloadfreetype2-16188ebfac8f179bfeb32a6a3147b4264516bc79.tar.gz
FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality.
All public FreeType enumeration and flag values are uppercase... * include/tttables.h (FT_Sfnt_Tag): Implement it. For backwards compatilibity, retain the old values as macros. * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c (get_sfnt_table): Updated.
-rw-r--r--ChangeLog12
-rw-r--r--include/tttables.h43
-rw-r--r--src/base/ftfstype.c4
-rw-r--r--src/sfnt/sfdriver.c22
4 files changed, 59 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c83a521a..8cc45ea3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-12-03 Werner Lemberg <wl@gnu.org>
+
+ FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality.
+
+ All public FreeType enumeration and flag values are uppercase...
+
+ * include/tttables.h (FT_Sfnt_Tag): Implement it. For backwards
+ compatilibity, retain the old values as macros.
+
+ * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c
+ (get_sfnt_table): Updated.
+
2014-12-02 Werner Lemberg <wl@gnu.org>
* include/*: Improve structure of documentation.
diff --git a/include/tttables.h b/include/tttables.h
index 164d821b4..e1d8b05e7 100644
--- a/include/tttables.h
+++ b/include/tttables.h
@@ -578,20 +578,45 @@ FT_BEGIN_HEADER
/* An enumeration used to specify the index of an SFNT table. */
/* Used in the @FT_Get_Sfnt_Table API function. */
/* */
+ /* <Values> */
+ /* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */
+ /* */
+ /* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */
+ /* */
+ /* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */
+ /* */
+ /* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */
+ /* */
+ /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */
+ /* */
+ /* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */
+ /* */
+ /* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */
+ /* */
typedef enum FT_Sfnt_Tag_
{
- ft_sfnt_head = 0, /* TT_Header */
- ft_sfnt_maxp = 1, /* TT_MaxProfile */
- ft_sfnt_os2 = 2, /* TT_OS2 */
- ft_sfnt_hhea = 3, /* TT_HoriHeader */
- ft_sfnt_vhea = 4, /* TT_VertHeader */
- ft_sfnt_post = 5, /* TT_Postscript */
- ft_sfnt_pclt = 6, /* TT_PCLT */
+ FT_SFNT_HEAD,
+ FT_SFNT_MAXP,
+ FT_SFNT_OS2,
+ FT_SFNT_HHEA,
+ FT_SFNT_VHEA,
+ FT_SFNT_POST,
+ FT_SFNT_PCLT,
- sfnt_max /* internal end mark */
+ FT_SFNT_MAX
} FT_Sfnt_Tag;
+ /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */
+ /* values instead */
+#define ft_sfnt_head FT_SFNT_HEAD
+#define ft_sfnt_maxp FT_SFNT_MAXP
+#define ft_sfnt_os2 FT_SFNT_OS2
+#define ft_sfnt_hhea FT_SFNT_HHEA
+#define ft_sfnt_vhea FT_SFNT_VHEA
+#define ft_sfnt_post FT_SFNT_POST
+#define ft_sfnt_pclt FT_SFNT_PCLT
+
/*************************************************************************/
/* */
@@ -628,7 +653,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* vert_header = */
- /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */
+ /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */
/* } */
/* */
FT_EXPORT( void* )
diff --git a/src/base/ftfstype.c b/src/base/ftfstype.c
index d0ef7b7c1..6b49ef837 100644
--- a/src/base/ftfstype.c
+++ b/src/base/ftfstype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file to access FSType data (body). */
/* */
-/* Copyright 2008, 2009 by */
+/* Copyright 2008, 2009, 2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -51,7 +51,7 @@
/* look at FSType before fsType for Type42 */
- if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL &&
+ if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL &&
os2->version != 0xFFFFU )
return os2->fsType;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index e4fcda5ec..bd8dd2e57 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -75,36 +75,36 @@
switch ( tag )
{
- case ft_sfnt_head:
+ case FT_SFNT_HEAD:
table = &face->header;
break;
- case ft_sfnt_hhea:
+ case FT_SFNT_HHEA:
table = &face->horizontal;
break;
- case ft_sfnt_vhea:
- table = face->vertical_info ? &face->vertical : 0;
+ case FT_SFNT_VHEA:
+ table = face->vertical_info ? &face->vertical : NULL;
break;
- case ft_sfnt_os2:
- table = face->os2.version == 0xFFFFU ? 0 : &face->os2;
+ case FT_SFNT_OS2:
+ table = face->os2.version == 0xFFFFU ? NULL : &face->os2;
break;
- case ft_sfnt_post:
+ case FT_SFNT_POST:
table = &face->postscript;
break;
- case ft_sfnt_maxp:
+ case FT_SFNT_MAXP:
table = &face->max_profile;
break;
- case ft_sfnt_pclt:
- table = face->pclt.Version ? &face->pclt : 0;
+ case FT_SFNT_PCLT:
+ table = face->pclt.Version ? &face->pclt : NULL;
break;
default:
- table = 0;
+ table = NULL;
}
return table;