1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4 This file is part of systemd.
6 Copyright (C) 2014 David Herrmann <dh.herrmann@gmail.com>
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
29 typedef struct unifont unifont;
30 typedef struct unifont_glyph unifont_glyph;
34 * The unifont API provides a glyph-lookup for bitmap fonts which can be used
35 * as fallback if no system-font is available or if you don't want to deal with
36 * full font renderers.
39 struct unifont_glyph {
44 const void *data; /* unaligned! */
47 int unifont_new(unifont **out);
48 unifont *unifont_ref(unifont *u);
49 unifont *unifont_unref(unifont *u);
51 DEFINE_TRIVIAL_CLEANUP_FUNC(unifont*, unifont_unref);
53 unsigned int unifont_get_width(unifont *u);
54 unsigned int unifont_get_height(unifont *u);
55 unsigned int unifont_get_stride(unifont *u);
56 int unifont_lookup(unifont *u, unifont_glyph *out, uint32_t ucs4);
57 void unifont_fallback(unifont_glyph *out);