/* ufont.h */

#ifndef ufont_H
#define ufont_H

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "oslib/font.h"
#include "oslib/os.h"

struct ufont_font;

typedef struct ufont_font *ufont_f;

extern os_error *
xufont_find_font(char const *font_name,
                 int xsize,
                 int ysize,
                 int xres,
                 int yres,
                 ufont_f *font,
                 int *xres_out,
                 int *yres_out);

extern os_error *
xufont_lose_font(ufont_f font);

extern os_error *
xufont_paint(ufont_f font,
             wchar_t const *string,
             font_string_flags flags,
             int xpos,
             int ypos,
             font_paint_block const *block,
             os_trfm const *trfm,
             unsigned int length);

extern os_error *
xufont_convert(ufont_f font,
               wchar_t const *string,
               unsigned int length,
               char **presult,
               unsigned int **ptable);

extern os_error *
xufont_scan_string(ufont_f font,
                   wchar_t const *string,
                   font_string_flags flags,
                   int x,
                   int y,
                   font_scan_block const *block,
                   os_trfm const *trfm,
                   unsigned int length,
                   int *split_length,
                   int *x_out,
                   int *y_out,
                   int *length_out);

#endif
