< prev index next >

src/java.desktop/share/native/libfreetype/src/base/ftsnames.c

Print this page


   1 /***************************************************************************/
   2 /*                                                                         */
   3 /*  ftsnames.c                                                             */
   4 /*                                                                         */
   5 /*    Simple interface to access SFNT name tables (which are used          */
   6 /*    to hold font names, copyright info, notices, etc.) (body).           */
   7 /*                                                                         */
   8 /*    This is _not_ used to retrieve glyph names!                          */
   9 /*                                                                         */
  10 /*  Copyright 1996-2018 by                                                 */
  11 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
  12 /*                                                                         */
  13 /*  This file is part of the FreeType project, and may only be used,       */
  14 /*  modified, and distributed under the terms of the FreeType project      */
  15 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
  16 /*  this file you indicate that you have read the license and              */
  17 /*  understand and accept it fully.                                        */
  18 /*                                                                         */
  19 /***************************************************************************/
  20 
  21 
  22 #include <ft2build.h>
  23 #include FT_INTERNAL_DEBUG_H
  24 
  25 #include FT_SFNT_NAMES_H
  26 #include FT_INTERNAL_TRUETYPE_TYPES_H
  27 #include FT_INTERNAL_STREAM_H
  28 
  29 
  30 #ifdef TT_CONFIG_OPTION_SFNT_NAMES
  31 
  32 
  33   /* documentation is in ftsnames.h */
  34 
  35   FT_EXPORT_DEF( FT_UInt )
  36   FT_Get_Sfnt_Name_Count( FT_Face  face )
  37   {
  38     return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0;
  39   }


 125           if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
 126                FT_STREAM_SEEK( entry->stringOffset )                ||
 127                FT_STREAM_READ( entry->string, entry->stringLength ) )
 128           {
 129             FT_FREE( entry->string );
 130             entry->stringLength = 0;
 131           }
 132         }
 133 
 134         alangTag->string     = (FT_Byte*)entry->string;
 135         alangTag->string_len = entry->stringLength;
 136 
 137         error = FT_Err_Ok;
 138       }
 139     }
 140 
 141     return error;
 142   }
 143 
 144 
 145 #endif /* TT_CONFIG_OPTION_SFNT_NAMES */






































 146 
 147 
 148 /* END */
   1 /****************************************************************************
   2  *
   3  * ftsnames.c
   4  *
   5  *   Simple interface to access SFNT name tables (which are used
   6  *   to hold font names, copyright info, notices, etc.) (body).
   7  *
   8  *   This is _not_ used to retrieve glyph names!
   9  *
  10  * Copyright (C) 1996-2019 by
  11  * David Turner, Robert Wilhelm, and Werner Lemberg.
  12  *
  13  * This file is part of the FreeType project, and may only be used,
  14  * modified, and distributed under the terms of the FreeType project
  15  * license, LICENSE.TXT.  By continuing to use, modify, or distribute
  16  * this file you indicate that you have read the license and
  17  * understand and accept it fully.
  18  *
  19  */
  20 
  21 
  22 #include <ft2build.h>
  23 #include FT_INTERNAL_DEBUG_H
  24 
  25 #include FT_SFNT_NAMES_H
  26 #include FT_INTERNAL_TRUETYPE_TYPES_H
  27 #include FT_INTERNAL_STREAM_H
  28 
  29 
  30 #ifdef TT_CONFIG_OPTION_SFNT_NAMES
  31 
  32 
  33   /* documentation is in ftsnames.h */
  34 
  35   FT_EXPORT_DEF( FT_UInt )
  36   FT_Get_Sfnt_Name_Count( FT_Face  face )
  37   {
  38     return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0;
  39   }


 125           if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||
 126                FT_STREAM_SEEK( entry->stringOffset )                ||
 127                FT_STREAM_READ( entry->string, entry->stringLength ) )
 128           {
 129             FT_FREE( entry->string );
 130             entry->stringLength = 0;
 131           }
 132         }
 133 
 134         alangTag->string     = (FT_Byte*)entry->string;
 135         alangTag->string_len = entry->stringLength;
 136 
 137         error = FT_Err_Ok;
 138       }
 139     }
 140 
 141     return error;
 142   }
 143 
 144 
 145 #else /* !TT_CONFIG_OPTION_SFNT_NAMES */
 146 
 147 
 148   FT_EXPORT_DEF( FT_UInt )
 149   FT_Get_Sfnt_Name_Count( FT_Face  face )
 150   {
 151     FT_UNUSED( face );
 152 
 153     return 0;
 154   }
 155 
 156 
 157   FT_EXPORT_DEF( FT_Error )
 158   FT_Get_Sfnt_Name( FT_Face       face,
 159                     FT_UInt       idx,
 160                     FT_SfntName  *aname )
 161   {
 162     FT_UNUSED( face );
 163     FT_UNUSED( idx );
 164     FT_UNUSED( aname );
 165 
 166     return FT_THROW( Unimplemented_Feature );
 167   }
 168 
 169 
 170   FT_EXPORT_DEF( FT_Error )
 171   FT_Get_Sfnt_LangTag( FT_Face          face,
 172                        FT_UInt          langID,
 173                        FT_SfntLangTag  *alangTag )
 174   {
 175     FT_UNUSED( face );
 176     FT_UNUSED( langID );
 177     FT_UNUSED( alangTag );
 178 
 179     return FT_THROW( Unimplemented_Feature );
 180   }
 181 
 182 
 183 #endif /* !TT_CONFIG_OPTION_SFNT_NAMES */
 184 
 185 
 186 /* END */
< prev index next >