src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h
changeset 54232 7c11a7cc7c1d
parent 50826 f5b95be8b6e2
equal deleted inserted replaced
54231:e4813eded7cb 54232:7c11a7cc7c1d
    31 #ifndef HB_OT_LAYOUT_H
    31 #ifndef HB_OT_LAYOUT_H
    32 #define HB_OT_LAYOUT_H
    32 #define HB_OT_LAYOUT_H
    33 
    33 
    34 #include "hb.h"
    34 #include "hb.h"
    35 
    35 
    36 #include "hb-ot-tag.h"
    36 #include "hb-ot-name.h"
    37 
    37 
    38 HB_BEGIN_DECLS
    38 HB_BEGIN_DECLS
    39 
    39 
    40 
    40 
    41 #define HB_OT_TAG_BASE HB_TAG('B','A','S','E')
    41 #define HB_OT_TAG_BASE HB_TAG('B','A','S','E')
    42 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
    42 #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F')
    43 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
    43 #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B')
    44 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
    44 #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S')
    45 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F')
    45 #define HB_OT_TAG_JSTF HB_TAG('J','S','T','F')
       
    46 
       
    47 
       
    48 /*
       
    49  * Script & Language tags.
       
    50  */
       
    51 
       
    52 #define HB_OT_TAG_DEFAULT_SCRIPT        HB_TAG ('D', 'F', 'L', 'T')
       
    53 #define HB_OT_TAG_DEFAULT_LANGUAGE      HB_TAG ('d', 'f', 'l', 't')
       
    54 
       
    55 /**
       
    56  * HB_OT_MAX_TAGS_PER_SCRIPT:
       
    57  *
       
    58  * Since: 2.0.0
       
    59  **/
       
    60 #define HB_OT_MAX_TAGS_PER_SCRIPT       3u
       
    61 /**
       
    62  * HB_OT_MAX_TAGS_PER_LANGUAGE:
       
    63  *
       
    64  * Since: 2.0.0
       
    65  **/
       
    66 #define HB_OT_MAX_TAGS_PER_LANGUAGE     3u
       
    67 
       
    68 HB_EXTERN void
       
    69 hb_ot_tags_from_script_and_language (hb_script_t   script,
       
    70                                      hb_language_t language,
       
    71                                      unsigned int *script_count /* IN/OUT */,
       
    72                                      hb_tag_t     *script_tags /* OUT */,
       
    73                                      unsigned int *language_count /* IN/OUT */,
       
    74                                      hb_tag_t     *language_tags /* OUT */);
       
    75 
       
    76 HB_EXTERN hb_script_t
       
    77 hb_ot_tag_to_script (hb_tag_t tag);
       
    78 
       
    79 HB_EXTERN hb_language_t
       
    80 hb_ot_tag_to_language (hb_tag_t tag);
       
    81 
       
    82 HB_EXTERN void
       
    83 hb_ot_tags_to_script_and_language (hb_tag_t       script_tag,
       
    84                                    hb_tag_t       language_tag,
       
    85                                    hb_script_t   *script /* OUT */,
       
    86                                    hb_language_t *language /* OUT */);
    46 
    87 
    47 
    88 
    48 /*
    89 /*
    49  * GDEF
    90  * GDEF
    50  */
    91  */
   109 hb_ot_layout_table_find_script (hb_face_t    *face,
   150 hb_ot_layout_table_find_script (hb_face_t    *face,
   110                                 hb_tag_t      table_tag,
   151                                 hb_tag_t      table_tag,
   111                                 hb_tag_t      script_tag,
   152                                 hb_tag_t      script_tag,
   112                                 unsigned int *script_index);
   153                                 unsigned int *script_index);
   113 
   154 
   114 /* Like find_script, but takes zero-terminated array of scripts to test */
   155 HB_EXTERN hb_bool_t
   115 HB_EXTERN hb_bool_t
   156 hb_ot_layout_table_select_script (hb_face_t      *face,
   116 hb_ot_layout_table_choose_script (hb_face_t      *face,
       
   117                                   hb_tag_t        table_tag,
   157                                   hb_tag_t        table_tag,
       
   158                                   unsigned int    script_count,
   118                                   const hb_tag_t *script_tags,
   159                                   const hb_tag_t *script_tags,
   119                                   unsigned int   *script_index,
   160                                   unsigned int   *script_index /* OUT */,
   120                                   hb_tag_t       *chosen_script);
   161                                   hb_tag_t       *chosen_script /* OUT */);
   121 
   162 
   122 HB_EXTERN unsigned int
   163 HB_EXTERN unsigned int
   123 hb_ot_layout_table_get_feature_tags (hb_face_t    *face,
   164 hb_ot_layout_table_get_feature_tags (hb_face_t    *face,
   124                                      hb_tag_t      table_tag,
   165                                      hb_tag_t      table_tag,
   125                                      unsigned int  start_offset,
   166                                      unsigned int  start_offset,
   133                                        unsigned int  start_offset,
   174                                        unsigned int  start_offset,
   134                                        unsigned int *language_count /* IN/OUT */,
   175                                        unsigned int *language_count /* IN/OUT */,
   135                                        hb_tag_t     *language_tags /* OUT */);
   176                                        hb_tag_t     *language_tags /* OUT */);
   136 
   177 
   137 HB_EXTERN hb_bool_t
   178 HB_EXTERN hb_bool_t
   138 hb_ot_layout_script_find_language (hb_face_t    *face,
   179 hb_ot_layout_script_select_language (hb_face_t      *face,
   139                                    hb_tag_t      table_tag,
   180                                      hb_tag_t        table_tag,
   140                                    unsigned int  script_index,
   181                                      unsigned int    script_index,
   141                                    hb_tag_t      language_tag,
   182                                      unsigned int    language_count,
   142                                    unsigned int *language_index);
   183                                      const hb_tag_t *language_tags,
       
   184                                      unsigned int   *language_index /* OUT */);
   143 
   185 
   144 HB_EXTERN hb_bool_t
   186 HB_EXTERN hb_bool_t
   145 hb_ot_layout_language_get_required_feature_index (hb_face_t    *face,
   187 hb_ot_layout_language_get_required_feature_index (hb_face_t    *face,
   146                                                   hb_tag_t      table_tag,
   188                                                   hb_tag_t      table_tag,
   147                                                   unsigned int  script_index,
   189                                                   unsigned int  script_index,
   192 
   234 
   193 HB_EXTERN unsigned int
   235 HB_EXTERN unsigned int
   194 hb_ot_layout_table_get_lookup_count (hb_face_t    *face,
   236 hb_ot_layout_table_get_lookup_count (hb_face_t    *face,
   195                                      hb_tag_t      table_tag);
   237                                      hb_tag_t      table_tag);
   196 
   238 
       
   239 HB_EXTERN void
       
   240 hb_ot_layout_collect_features (hb_face_t      *face,
       
   241                                hb_tag_t        table_tag,
       
   242                                const hb_tag_t *scripts,
       
   243                                const hb_tag_t *languages,
       
   244                                const hb_tag_t *features,
       
   245                                hb_set_t       *feature_indexes /* OUT */);
   197 
   246 
   198 HB_EXTERN void
   247 HB_EXTERN void
   199 hb_ot_layout_collect_lookups (hb_face_t      *face,
   248 hb_ot_layout_collect_lookups (hb_face_t      *face,
   200                               hb_tag_t        table_tag,
   249                               hb_tag_t        table_tag,
   201                               const hb_tag_t *scripts,
   250                               const hb_tag_t *scripts,
   205 
   254 
   206 HB_EXTERN void
   255 HB_EXTERN void
   207 hb_ot_layout_lookup_collect_glyphs (hb_face_t    *face,
   256 hb_ot_layout_lookup_collect_glyphs (hb_face_t    *face,
   208                                     hb_tag_t      table_tag,
   257                                     hb_tag_t      table_tag,
   209                                     unsigned int  lookup_index,
   258                                     unsigned int  lookup_index,
   210                                     hb_set_t     *glyphs_before, /* OUT. May be NULL */
   259                                     hb_set_t     *glyphs_before, /* OUT.  May be NULL */
   211                                     hb_set_t     *glyphs_input,  /* OUT. May be NULL */
   260                                     hb_set_t     *glyphs_input,  /* OUT.  May be NULL */
   212                                     hb_set_t     *glyphs_after,  /* OUT. May be NULL */
   261                                     hb_set_t     *glyphs_after,  /* OUT.  May be NULL */
   213                                     hb_set_t     *glyphs_output  /* OUT. May be NULL */);
   262                                     hb_set_t     *glyphs_output  /* OUT.  May be NULL */);
   214 
   263 
   215 #ifdef HB_NOT_IMPLEMENTED
   264 #ifdef HB_NOT_IMPLEMENTED
   216 typedef struct
   265 typedef struct
   217 {
   266 {
   218   const hb_codepoint_t *before,
   267   const hb_codepoint_t *before,
   313 #endif
   362 #endif
   314 
   363 
   315 /* Optical 'size' feature info.  Returns true if found.
   364 /* Optical 'size' feature info.  Returns true if found.
   316  * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
   365  * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
   317 HB_EXTERN hb_bool_t
   366 HB_EXTERN hb_bool_t
   318 hb_ot_layout_get_size_params (hb_face_t    *face,
   367 hb_ot_layout_get_size_params (hb_face_t       *face,
   319                               unsigned int *design_size,       /* OUT.  May be NULL */
   368                               unsigned int    *design_size,       /* OUT.  May be NULL */
   320                               unsigned int *subfamily_id,      /* OUT.  May be NULL */
   369                               unsigned int    *subfamily_id,      /* OUT.  May be NULL */
   321                               unsigned int *subfamily_name_id, /* OUT.  May be NULL */
   370                               hb_ot_name_id_t *subfamily_name_id, /* OUT.  May be NULL */
   322                               unsigned int *range_start,       /* OUT.  May be NULL */
   371                               unsigned int    *range_start,       /* OUT.  May be NULL */
   323                               unsigned int *range_end          /* OUT.  May be NULL */);
   372                               unsigned int    *range_end          /* OUT.  May be NULL */);
   324 
   373 
   325 
   374 
   326 /*
   375 HB_EXTERN hb_bool_t
   327  * BASE
   376 hb_ot_layout_feature_get_name_ids (hb_face_t       *face,
   328  */
   377                                    hb_tag_t         table_tag,
   329 #if 0
   378                                    unsigned int     feature_index,
   330 
   379                                    hb_ot_name_id_t *label_id             /* OUT.  May be NULL */,
   331 #define HB_OT_TAG_BASE_HANG HB_TAG('h','a','n','g')
   380                                    hb_ot_name_id_t *tooltip_id           /* OUT.  May be NULL */,
   332 #define HB_OT_TAG_BASE_ICFB HB_TAG('i','c','f','b')
   381                                    hb_ot_name_id_t *sample_id            /* OUT.  May be NULL */,
   333 #define HB_OT_TAG_BASE_ICFT HB_TAG('i','c','f','t')
   382                                    unsigned int    *num_named_parameters /* OUT.  May be NULL */,
   334 #define HB_OT_TAG_BASE_IDEO HB_TAG('i','d','e','o')
   383                                    hb_ot_name_id_t *first_param_id       /* OUT.  May be NULL */);
   335 #define HB_OT_TAG_BASE_IDTB HB_TAG('i','d','t','b')
   384 
   336 #define HB_OT_TAG_BASE_MATH HB_TAG('m','a','t','h')
   385 
   337 #define HB_OT_TAG_BASE_ROMN HB_TAG('r','o','m','n')
   386 HB_EXTERN unsigned int
   338 
   387 hb_ot_layout_feature_get_characters (hb_face_t      *face,
   339 #endif
   388                                      hb_tag_t        table_tag,
   340 
   389                                      unsigned int    feature_index,
       
   390                                      unsigned int    start_offset,
       
   391                                      unsigned int   *char_count    /* IN/OUT.  May be NULL */,
       
   392                                      hb_codepoint_t *characters    /* OUT.     May be NULL */);
   341 
   393 
   342 HB_END_DECLS
   394 HB_END_DECLS
   343 
   395 
   344 #endif /* HB_OT_LAYOUT_H */
   396 #endif /* HB_OT_LAYOUT_H */