1 /* 2 * Copyright © 2018 Ebrahim Byagowi. 3 * 4 * This is part of HarfBuzz, a text shaping library. 5 * 6 * Permission is hereby granted, without written agreement and without 7 * license or royalty fees, to use, copy, modify, and distribute this 8 * software and its documentation for any purpose, provided that the 9 * above copyright notice and the following two paragraphs appear in 10 * all copies of this software. 11 * 12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 * DAMAGE. 17 * 18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 */ 24 25 #if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) 26 #error "Include <hb-ot.h> instead." 27 #endif 28 29 #ifndef HB_OT_NAME_H 30 #define HB_OT_NAME_H 31 32 #include "hb.h" 33 34 HB_BEGIN_DECLS 35 36 37 /** 38 * hb_ot_name_id_t: 39 * @HB_OT_NAME_ID_COPYRIGHT: Copyright notice 40 * @HB_OT_NAME_ID_FONT_FAMILY: Font Family name 41 * @HB_OT_NAME_ID_FONT_SUBFAMILY: Font Subfamily name 42 * @HB_OT_NAME_ID_UNIQUE_ID: Unique font identifier 43 * @HB_OT_NAME_ID_FULL_NAME: Full font name that reflects 44 * all family and relevant subfamily descriptors 45 * @HB_OT_NAME_ID_VERSION_STRING: Version string 46 * @HB_OT_NAME_ID_POSTSCRIPT_NAME: PostScript name for the font 47 * @HB_OT_NAME_ID_TRADEMARK: Trademark 48 * @HB_OT_NAME_ID_MANUFACTURER: Manufacturer Name 49 * @HB_OT_NAME_ID_DESIGNER: Designer 50 * @HB_OT_NAME_ID_DESCRIPTION: Description 51 * @HB_OT_NAME_ID_VENDOR_URL: URL of font vendor 52 * @HB_OT_NAME_ID_DESIGNER_URL: URL of typeface designer 53 * @HB_OT_NAME_ID_LICENSE: License Description 54 * @HB_OT_NAME_ID_LICENSE_URL: URL where additional licensing 55 * information can be found 56 * @HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY: Typographic Family name 57 * @HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY: Typographic Subfamily name 58 * @HB_OT_NAME_ID_MAC_FULL_NAME: Compatible Full Name for MacOS 59 * @HB_OT_NAME_ID_SAMPLE_TEXT: Sample text 60 * @HB_OT_NAME_ID_CID_FINDFONT_NAME: PostScript CID findfont name 61 * @HB_OT_NAME_ID_WWS_FAMILY: WWS Family Name 62 * @HB_OT_NAME_ID_WWS_SUBFAMILY: WWS Subfamily Name 63 * @HB_OT_NAME_ID_LIGHT_BACKGROUND: Light Background Palette 64 * @HB_OT_NAME_ID_DARK_BACKGROUND: Dark Background Palette 65 * @HB_OT_NAME_ID_VARIATIONS_PS_PREFIX: Variations PostScript Name Prefix 66 * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID. 67 * 68 * An integral type representing an OpenType 'name' table name identifier. 69 * There are predefined name IDs, as well as name IDs return from other 70 * API. These can be used to fetch name strings from a font face. 71 * 72 * For more information on these fields, see the 73 * [OpenType spec](https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids). 74 * 75 * Since: 2.0.0 76 **/ 77 enum 78 { 79 HB_OT_NAME_ID_COPYRIGHT = 0, 80 HB_OT_NAME_ID_FONT_FAMILY = 1, 81 HB_OT_NAME_ID_FONT_SUBFAMILY = 2, 82 HB_OT_NAME_ID_UNIQUE_ID = 3, 83 HB_OT_NAME_ID_FULL_NAME = 4, 84 HB_OT_NAME_ID_VERSION_STRING = 5, 85 HB_OT_NAME_ID_POSTSCRIPT_NAME = 6, 86 HB_OT_NAME_ID_TRADEMARK = 7, 87 HB_OT_NAME_ID_MANUFACTURER = 8, 88 HB_OT_NAME_ID_DESIGNER = 9, 89 HB_OT_NAME_ID_DESCRIPTION = 10, 90 HB_OT_NAME_ID_VENDOR_URL = 11, 91 HB_OT_NAME_ID_DESIGNER_URL = 12, 92 HB_OT_NAME_ID_LICENSE = 13, 93 HB_OT_NAME_ID_LICENSE_URL = 14, 94 /*HB_OT_NAME_ID_RESERVED = 15,*/ 95 HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16, 96 HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17, 97 HB_OT_NAME_ID_MAC_FULL_NAME = 18, 98 HB_OT_NAME_ID_SAMPLE_TEXT = 19, 99 HB_OT_NAME_ID_CID_FINDFONT_NAME = 20, 100 HB_OT_NAME_ID_WWS_FAMILY = 21, 101 HB_OT_NAME_ID_WWS_SUBFAMILY = 22, 102 HB_OT_NAME_ID_LIGHT_BACKGROUND = 23, 103 HB_OT_NAME_ID_DARK_BACKGROUND = 24, 104 HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25, 105 106 HB_OT_NAME_ID_INVALID = 0xFFFF 107 }; 108 109 typedef unsigned int hb_ot_name_id_t; 110 111 112 /** 113 * hb_ot_name_entry_t: 114 * @name_id: name ID 115 * @language: language 116 * 117 * Structure representing a name ID in a particular language. 118 * 119 * Since: 2.1.0 120 **/ 121 typedef struct hb_ot_name_entry_t { 122 hb_ot_name_id_t name_id; 123 /*< private >*/ 124 hb_var_int_t var; 125 /*< public >*/ 126 hb_language_t language; 127 } hb_ot_name_entry_t; 128 129 HB_EXTERN const hb_ot_name_entry_t * 130 hb_ot_name_list_names (hb_face_t *face, 131 unsigned int *num_entries /* OUT */); 132 133 134 HB_EXTERN unsigned int 135 hb_ot_name_get_utf8 (hb_face_t *face, 136 hb_ot_name_id_t name_id, 137 hb_language_t language, 138 unsigned int *text_size /* IN/OUT */, 139 char *text /* OUT */); 140 141 HB_EXTERN unsigned int 142 hb_ot_name_get_utf16 (hb_face_t *face, 143 hb_ot_name_id_t name_id, 144 hb_language_t language, 145 unsigned int *text_size /* IN/OUT */, 146 uint16_t *text /* OUT */); 147 148 HB_EXTERN unsigned int 149 hb_ot_name_get_utf32 (hb_face_t *face, 150 hb_ot_name_id_t name_id, 151 hb_language_t language, 152 unsigned int *text_size /* IN/OUT */, 153 uint32_t *text /* OUT */); 154 155 156 HB_END_DECLS 157 158 #endif /* HB_OT_NAME_H */ 159