unifont-internal.h revision 86db5dfb6d334e583ea4161191754522ce850eed
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering/***
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering This file is part of systemd.
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering Copyright (C) 2014 David Herrmann <dh.herrmann@gmail.com>
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering systemd is free software; you can redistribute it and/or modify it
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering under the terms of the GNU Lesser General Public License as published by
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering (at your option) any later version.
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering systemd is distributed in the hope that it will be useful, but
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering Lesser General Public License for more details.
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering You should have received a copy of the GNU Lesser General Public License
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering***/
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering#pragma once
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering#include <stdbool.h>
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering#include <stdint.h>
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering#include <stdlib.h>
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering#include "util.h"
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringtypedef struct unifont unifont;
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringtypedef struct unifont_glyph unifont_glyph;
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering/*
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering * Unifont
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering * The unifont API provides a glyph-lookup for bitmap fonts which can be used
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering * as fallback if no system-font is available or if you don't want to deal with
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering * full font renderers.
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering */
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringstruct unifont_glyph {
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering unsigned int width;
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering unsigned int height;
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering unsigned int stride;
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering unsigned int cwidth;
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering const void *data; /* unaligned! */
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering};
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringint unifont_new(unifont **out);
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringunifont *unifont_ref(unifont *u);
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringunifont *unifont_unref(unifont *u);
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(unifont*, unifont_unref);
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringunsigned int unifont_get_stride(unifont *u);
160cd5c9aa2301892e13950015de7968c764340dLennart Poetteringint unifont_lookup(unifont *u, unifont_glyph *out, uint32_t ucs4);
160cd5c9aa2301892e13950015de7968c764340dLennart Poettering