diff options
author | James Bursa <james@netsurf-browser.org> | 2005-01-08 21:02:32 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-01-08 21:02:32 +0000 |
commit | c4580a33f78825e385626610fbbff9a675b248a4 (patch) | |
tree | d4ab197d183e4a917202415cb7bd44b75d5c7866 /rufl.h | |
download | librufl-c4580a33f78825e385626610fbbff9a675b248a4.tar.gz librufl-c4580a33f78825e385626610fbbff9a675b248a4.tar.bz2 |
[project @ 2005-01-08 21:02:32 by bursa]
Initial version of RISC OS Unicode font library. Require Unicode (RO5) Font Manager.
svn path=/import/rufl/; revision=2443
Diffstat (limited to 'rufl.h')
-rw-r--r-- | rufl.h | 77 |
1 files changed, 77 insertions, 0 deletions
@@ -0,0 +1,77 @@ +/* + * This file is part of RUfl + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license + * Copyright 2005 James Bursa <james@semichrome.net> + */ + +#include <stdbool.h> +#include <stdlib.h> +#include "oslib/os.h" + + +/** Return code for RUfl functions. */ +typedef enum { + /** Success. */ + rufl_OK, + /** Failure: memory was exhausted. */ + rufl_OUT_OF_MEMORY, + /** Failure: Font Manager error; details in rufl_fm_error. */ + rufl_FONT_MANAGER_ERROR, + /** Failure: no font with this name exists. */ + rufl_FONT_NOT_FOUND, + /** Failure: file input / output error: details in errno. */ + rufl_IO_ERROR, + /** Failure: file input unexpected eof. */ + rufl_IO_EOF, +} rufl_code; + + +typedef enum { + rufl_REGULAR, + rufl_SLANTED, + rufl_BOLD, + rufl_BOLD_SLANTED, +} rufl_style; + + +/** Last Font Manager error. */ +extern os_error *rufl_fm_error; + +/** List of available font families. */ +extern char **rufl_family_list; +/** Number of entries in rufl_family_list. */ +extern unsigned int rufl_family_list_entries; + + +/** + * Initialise RUfl. + * + * All available fonts are scanned. May take some time. + */ + +rufl_code rufl_init(void); + + +/** + * Render Unicode text. + */ + +rufl_code rufl_paint(const char *font_family, rufl_style font_style, + unsigned int font_size, + const char *string, size_t length, + int x, int y); + + +/** + * Dump the internal library state to stdout. + */ + +void rufl_dump_state(void); + + +/** + * Free all resources used by the library. + */ + +void rufl_quit(void); |