summaryrefslogtreecommitdiff
path: root/src/sfntfont.h
blob: 0e57ee350282227c5d7976715360d0b7fa03948c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* sfnt format font driver for GNU Emacs.

Copyright (C) 2023-2024 Free Software Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */

#ifndef _SFNTFONT_H_
#define _SFNTFONT_H_

#include "lisp.h"
#include "frame.h"
#include "font.h"
#include "sfnt.h"

extern int sfnt_enum_font (const char *);


/* Font driver callbacks.  */

extern Lisp_Object sfntfont_list (struct frame *, Lisp_Object);
extern Lisp_Object sfntfont_match (struct frame *, Lisp_Object);
extern Lisp_Object sfntfont_open (struct frame *, Lisp_Object, int);

extern unsigned int sfntfont_encode_char (struct font *, int);
extern void sfntfont_text_extents (struct font *, const unsigned int *,
				   int, struct font_metrics *);
extern void sfntfont_close (struct font *);
extern int sfntfont_draw (struct glyph_string *, int, int,
			  int, int, bool);
extern Lisp_Object sfntfont_list_family (struct frame *);
extern int sfntfont_get_variation_glyphs (struct font *, int, unsigned[256]);


/* Initialization functions.  */

typedef void (*sfntfont_put_glyph_proc) (struct glyph_string *, int, int,
					 int, int, bool, struct sfnt_raster **,
					 int *);

extern void syms_of_sfntfont (void);
extern void init_sfntfont (void);
extern void mark_sfntfont (void);
extern void init_sfntfont_vendor (Lisp_Object, const struct font_driver *,
				  sfntfont_put_glyph_proc);


/* mmap specific functions.  */

#ifdef HAVE_MMAP

extern bool sfntfont_detect_sigbus (void *);

#endif /* HAVE_MMAP */



/* HarfBuzz specific functions.  */

#ifdef HAVE_HARFBUZZ

extern hb_font_t *sfntfont_begin_hb_font (struct font *, double *);

#endif /* HAVE_HARFBUZZ */

#endif /* _SFNTFONT_H_ */