Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:04:01

0001 /*
0002  * Copyright © 2022 Red Hat, Inc.
0003  *
0004  *  This is part of HarfBuzz, a text shaping library.
0005  *
0006  * Permission is hereby granted, without written agreement and without
0007  * license or royalty fees, to use, copy, modify, and distribute this
0008  * software and its documentation for any purpose, provided that the
0009  * above copyright notice and the following two paragraphs appear in
0010  * all copies of this software.
0011  *
0012  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
0013  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
0014  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
0015  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
0016  * DAMAGE.
0017  *
0018  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
0019  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
0020  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
0021  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
0022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
0023  *
0024  * Red Hat Author(s): Matthias Clasen
0025  */
0026 
0027 #ifndef HB_CAIRO_H
0028 #define HB_CAIRO_H
0029 
0030 #include "hb.h"
0031 
0032 #include <cairo.h>
0033 
0034 HB_BEGIN_DECLS
0035 
0036 HB_EXTERN cairo_font_face_t *
0037 hb_cairo_font_face_create_for_font (hb_font_t *font);
0038 
0039 HB_EXTERN hb_font_t *
0040 hb_cairo_font_face_get_font (cairo_font_face_t *font_face);
0041 
0042 HB_EXTERN cairo_font_face_t *
0043 hb_cairo_font_face_create_for_face (hb_face_t *face);
0044 
0045 HB_EXTERN hb_face_t *
0046 hb_cairo_font_face_get_face (cairo_font_face_t *font_face);
0047 
0048 /**
0049  * hb_cairo_font_init_func_t:
0050  * @font: The #hb_font_t being created
0051  * @scaled_font: The respective #cairo_scaled_font_t
0052  * @user_data: User data accompanying this method
0053  *
0054  * The type of a virtual method to be called when a cairo
0055  * face created using hb_cairo_font_face_create_for_face()
0056  * creates an #hb_font_t for a #cairo_scaled_font_t.
0057  *
0058  * Return value: the #hb_font_t value to use; in most cases same as @font
0059  *
0060  * Since: 7.0.0
0061  */
0062 typedef hb_font_t * (*hb_cairo_font_init_func_t) (hb_font_t *font,
0063                           cairo_scaled_font_t *scaled_font,
0064                           void *user_data);
0065 
0066 HB_EXTERN void
0067 hb_cairo_font_face_set_font_init_func (cairo_font_face_t *font_face,
0068                        hb_cairo_font_init_func_t func,
0069                        void *user_data,
0070                        hb_destroy_func_t destroy);
0071 
0072 HB_EXTERN hb_font_t *
0073 hb_cairo_scaled_font_get_font (cairo_scaled_font_t *scaled_font);
0074 
0075 HB_EXTERN void
0076 hb_cairo_font_face_set_scale_factor (cairo_font_face_t *font_face,
0077                      unsigned int scale_factor);
0078 
0079 HB_EXTERN unsigned int
0080 hb_cairo_font_face_get_scale_factor (cairo_font_face_t *font_face);
0081 
0082 HB_EXTERN void
0083 hb_cairo_glyphs_from_buffer (hb_buffer_t *buffer,
0084                  hb_bool_t utf8_clusters,
0085                  double x_scale_factor,
0086                  double y_scale_factor,
0087                  double x,
0088                  double y,
0089                  const char *utf8,
0090                  int utf8_len,
0091                  cairo_glyph_t **glyphs,
0092                  unsigned int *num_glyphs,
0093                  cairo_text_cluster_t **clusters,
0094                  unsigned int *num_clusters,
0095                  cairo_text_cluster_flags_t *cluster_flags);
0096 
0097 HB_END_DECLS
0098 
0099 #endif /* HB_CAIRO_H */