Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /***************************************************************************/ |
michael@0 | 2 | /* */ |
michael@0 | 3 | /* ftsnames.h */ |
michael@0 | 4 | /* */ |
michael@0 | 5 | /* Simple interface to access SFNT name tables (which are used */ |
michael@0 | 6 | /* to hold font names, copyright info, notices, etc.) (specification). */ |
michael@0 | 7 | /* */ |
michael@0 | 8 | /* This is _not_ used to retrieve glyph names! */ |
michael@0 | 9 | /* */ |
michael@0 | 10 | /* Copyright 1996-2003, 2006, 2009, 2010, 2013 by */ |
michael@0 | 11 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
michael@0 | 12 | /* */ |
michael@0 | 13 | /* This file is part of the FreeType project, and may only be used, */ |
michael@0 | 14 | /* modified, and distributed under the terms of the FreeType project */ |
michael@0 | 15 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
michael@0 | 16 | /* this file you indicate that you have read the license and */ |
michael@0 | 17 | /* understand and accept it fully. */ |
michael@0 | 18 | /* */ |
michael@0 | 19 | /***************************************************************************/ |
michael@0 | 20 | |
michael@0 | 21 | |
michael@0 | 22 | #ifndef __FT_SFNT_NAMES_H__ |
michael@0 | 23 | #define __FT_SFNT_NAMES_H__ |
michael@0 | 24 | |
michael@0 | 25 | |
michael@0 | 26 | #include <ft2build.h> |
michael@0 | 27 | #include FT_FREETYPE_H |
michael@0 | 28 | |
michael@0 | 29 | #ifdef FREETYPE_H |
michael@0 | 30 | #error "freetype.h of FreeType 1 has been loaded!" |
michael@0 | 31 | #error "Please fix the directory search order for header files" |
michael@0 | 32 | #error "so that freetype.h of FreeType 2 is found first." |
michael@0 | 33 | #endif |
michael@0 | 34 | |
michael@0 | 35 | |
michael@0 | 36 | FT_BEGIN_HEADER |
michael@0 | 37 | |
michael@0 | 38 | |
michael@0 | 39 | /*************************************************************************/ |
michael@0 | 40 | /* */ |
michael@0 | 41 | /* <Section> */ |
michael@0 | 42 | /* sfnt_names */ |
michael@0 | 43 | /* */ |
michael@0 | 44 | /* <Title> */ |
michael@0 | 45 | /* SFNT Names */ |
michael@0 | 46 | /* */ |
michael@0 | 47 | /* <Abstract> */ |
michael@0 | 48 | /* Access the names embedded in TrueType and OpenType files. */ |
michael@0 | 49 | /* */ |
michael@0 | 50 | /* <Description> */ |
michael@0 | 51 | /* The TrueType and OpenType specifications allow the inclusion of */ |
michael@0 | 52 | /* a special `names table' in font files. This table contains */ |
michael@0 | 53 | /* textual (and internationalized) information regarding the font, */ |
michael@0 | 54 | /* like family name, copyright, version, etc. */ |
michael@0 | 55 | /* */ |
michael@0 | 56 | /* The definitions below are used to access them if available. */ |
michael@0 | 57 | /* */ |
michael@0 | 58 | /* Note that this has nothing to do with glyph names! */ |
michael@0 | 59 | /* */ |
michael@0 | 60 | /*************************************************************************/ |
michael@0 | 61 | |
michael@0 | 62 | |
michael@0 | 63 | /*************************************************************************/ |
michael@0 | 64 | /* */ |
michael@0 | 65 | /* <Struct> */ |
michael@0 | 66 | /* FT_SfntName */ |
michael@0 | 67 | /* */ |
michael@0 | 68 | /* <Description> */ |
michael@0 | 69 | /* A structure used to model an SFNT `name' table entry. */ |
michael@0 | 70 | /* */ |
michael@0 | 71 | /* <Fields> */ |
michael@0 | 72 | /* platform_id :: The platform ID for `string'. */ |
michael@0 | 73 | /* */ |
michael@0 | 74 | /* encoding_id :: The encoding ID for `string'. */ |
michael@0 | 75 | /* */ |
michael@0 | 76 | /* language_id :: The language ID for `string'. */ |
michael@0 | 77 | /* */ |
michael@0 | 78 | /* name_id :: An identifier for `string'. */ |
michael@0 | 79 | /* */ |
michael@0 | 80 | /* string :: The `name' string. Note that its format differs */ |
michael@0 | 81 | /* depending on the (platform,encoding) pair. It can */ |
michael@0 | 82 | /* be a Pascal String, a UTF-16 one, etc. */ |
michael@0 | 83 | /* */ |
michael@0 | 84 | /* Generally speaking, the string is not */ |
michael@0 | 85 | /* zero-terminated. Please refer to the TrueType */ |
michael@0 | 86 | /* specification for details. */ |
michael@0 | 87 | /* */ |
michael@0 | 88 | /* string_len :: The length of `string' in bytes. */ |
michael@0 | 89 | /* */ |
michael@0 | 90 | /* <Note> */ |
michael@0 | 91 | /* Possible values for `platform_id', `encoding_id', `language_id', */ |
michael@0 | 92 | /* and `name_id' are given in the file `ttnameid.h'. For details */ |
michael@0 | 93 | /* please refer to the TrueType or OpenType specification. */ |
michael@0 | 94 | /* */ |
michael@0 | 95 | /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ |
michael@0 | 96 | /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ |
michael@0 | 97 | /* */ |
michael@0 | 98 | typedef struct FT_SfntName_ |
michael@0 | 99 | { |
michael@0 | 100 | FT_UShort platform_id; |
michael@0 | 101 | FT_UShort encoding_id; |
michael@0 | 102 | FT_UShort language_id; |
michael@0 | 103 | FT_UShort name_id; |
michael@0 | 104 | |
michael@0 | 105 | FT_Byte* string; /* this string is *not* null-terminated! */ |
michael@0 | 106 | FT_UInt string_len; /* in bytes */ |
michael@0 | 107 | |
michael@0 | 108 | } FT_SfntName; |
michael@0 | 109 | |
michael@0 | 110 | |
michael@0 | 111 | /*************************************************************************/ |
michael@0 | 112 | /* */ |
michael@0 | 113 | /* <Function> */ |
michael@0 | 114 | /* FT_Get_Sfnt_Name_Count */ |
michael@0 | 115 | /* */ |
michael@0 | 116 | /* <Description> */ |
michael@0 | 117 | /* Retrieve the number of name strings in the SFNT `name' table. */ |
michael@0 | 118 | /* */ |
michael@0 | 119 | /* <Input> */ |
michael@0 | 120 | /* face :: A handle to the source face. */ |
michael@0 | 121 | /* */ |
michael@0 | 122 | /* <Return> */ |
michael@0 | 123 | /* The number of strings in the `name' table. */ |
michael@0 | 124 | /* */ |
michael@0 | 125 | FT_EXPORT( FT_UInt ) |
michael@0 | 126 | FT_Get_Sfnt_Name_Count( FT_Face face ); |
michael@0 | 127 | |
michael@0 | 128 | |
michael@0 | 129 | /*************************************************************************/ |
michael@0 | 130 | /* */ |
michael@0 | 131 | /* <Function> */ |
michael@0 | 132 | /* FT_Get_Sfnt_Name */ |
michael@0 | 133 | /* */ |
michael@0 | 134 | /* <Description> */ |
michael@0 | 135 | /* Retrieve a string of the SFNT `name' table for a given index. */ |
michael@0 | 136 | /* */ |
michael@0 | 137 | /* <Input> */ |
michael@0 | 138 | /* face :: A handle to the source face. */ |
michael@0 | 139 | /* */ |
michael@0 | 140 | /* idx :: The index of the `name' string. */ |
michael@0 | 141 | /* */ |
michael@0 | 142 | /* <Output> */ |
michael@0 | 143 | /* aname :: The indexed @FT_SfntName structure. */ |
michael@0 | 144 | /* */ |
michael@0 | 145 | /* <Return> */ |
michael@0 | 146 | /* FreeType error code. 0~means success. */ |
michael@0 | 147 | /* */ |
michael@0 | 148 | /* <Note> */ |
michael@0 | 149 | /* The `string' array returned in the `aname' structure is not */ |
michael@0 | 150 | /* null-terminated. The application should deallocate it if it is no */ |
michael@0 | 151 | /* longer in use. */ |
michael@0 | 152 | /* */ |
michael@0 | 153 | /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ |
michael@0 | 154 | /* `name' table entries, then do a loop until you get the right */ |
michael@0 | 155 | /* platform, encoding, and name ID. */ |
michael@0 | 156 | /* */ |
michael@0 | 157 | FT_EXPORT( FT_Error ) |
michael@0 | 158 | FT_Get_Sfnt_Name( FT_Face face, |
michael@0 | 159 | FT_UInt idx, |
michael@0 | 160 | FT_SfntName *aname ); |
michael@0 | 161 | |
michael@0 | 162 | |
michael@0 | 163 | /*************************************************************************** |
michael@0 | 164 | * |
michael@0 | 165 | * @constant: |
michael@0 | 166 | * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY |
michael@0 | 167 | * |
michael@0 | 168 | * @description: |
michael@0 | 169 | * A constant used as the tag of @FT_Parameter structures to make |
michael@0 | 170 | * FT_Open_Face() ignore preferred family subfamily names in `name' |
michael@0 | 171 | * table since OpenType version 1.4. For backwards compatibility with |
michael@0 | 172 | * legacy systems that have a 4-face-per-family restriction. |
michael@0 | 173 | * |
michael@0 | 174 | */ |
michael@0 | 175 | #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) |
michael@0 | 176 | |
michael@0 | 177 | |
michael@0 | 178 | /*************************************************************************** |
michael@0 | 179 | * |
michael@0 | 180 | * @constant: |
michael@0 | 181 | * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY |
michael@0 | 182 | * |
michael@0 | 183 | * @description: |
michael@0 | 184 | * A constant used as the tag of @FT_Parameter structures to make |
michael@0 | 185 | * FT_Open_Face() ignore preferred subfamily names in `name' table since |
michael@0 | 186 | * OpenType version 1.4. For backwards compatibility with legacy |
michael@0 | 187 | * systems that have a 4-face-per-family restriction. |
michael@0 | 188 | * |
michael@0 | 189 | */ |
michael@0 | 190 | #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) |
michael@0 | 191 | |
michael@0 | 192 | /* */ |
michael@0 | 193 | |
michael@0 | 194 | |
michael@0 | 195 | FT_END_HEADER |
michael@0 | 196 | |
michael@0 | 197 | #endif /* __FT_SFNT_NAMES_H__ */ |
michael@0 | 198 | |
michael@0 | 199 | |
michael@0 | 200 | /* END */ |