NetSurf
|
#include "amiga/os3support.h"
#include <stdlib.h>
#include <string.h>
#include <proto/diskfont.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/utility.h>
#include <graphics/rpattr.h>
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/nsoption.h"
#include "amiga/font.h"
#include "amiga/font_diskfont.h"
#include "amiga/gui.h"
#include "amiga/plotters.h"
#include "amiga/utf8.h"
Go to the source code of this file.
Macros | |
#define | MAX_FONT_NAME_SIZE 33 |
Functions | |
static struct TextFont * | ami_font_bm_open (struct RastPort *rp, const plot_font_style_t *fstyle) |
static size_t | ami_font_bm_convert_local_to_utf8_offset (const char *utf8string, size_t length, UWORD offset) |
static nserror | amiga_bm_nsfont_width (const plot_font_style_t *fstyle, const char *string, size_t length, int *width) |
static nserror | amiga_bm_nsfont_position_in_string (const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find the position in a string where an x coordinate falls. More... | |
static nserror | amiga_bm_nsfont_split (const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) |
Find where to split a string to make it fit a width. More... | |
static ULONG | amiga_bm_nsfont_text (struct RastPort *rp, const char *string, ULONG length, const plot_font_style_t *fstyle, ULONG dx, ULONG dy, bool aa) |
void | ami_font_diskfont_init (void) |
void | ami_font_diskfont_fini (void) |
Variables | |
static plot_font_style_t * | prev_fstyle = NULL |
static struct TextFont * | prev_font = NULL |
static struct RastPort | temp_rp |
const struct ami_font_functions | ami_font_diskfont_table |
#define MAX_FONT_NAME_SIZE 33 |
Definition at line 40 of file font_diskfont.c.
|
static |
Definition at line 120 of file font_diskfont.c.
References utf8_next().
Referenced by amiga_bm_nsfont_position_in_string(), and amiga_bm_nsfont_split().
|
static |
Definition at line 46 of file font_diskfont.c.
References plot_font_style::family, plot_font_style::flags, FONTF_ITALIC, FONTF_OBLIQUE, MAX_FONT_NAME_SIZE, NSLOG, nsoption_charp, PLOT_FONT_FAMILY_CURSIVE, PLOT_FONT_FAMILY_FANTASY, PLOT_FONT_FAMILY_MONOSPACE, PLOT_FONT_FAMILY_SANS_SERIF, PLOT_FONT_FAMILY_SERIF, PLOT_STYLE_SCALE, prev_font, prev_fstyle, plot_font_style::size, and plot_font_style::weight.
Referenced by amiga_bm_nsfont_position_in_string(), amiga_bm_nsfont_split(), amiga_bm_nsfont_text(), and amiga_bm_nsfont_width().
void ami_font_diskfont_fini | ( | void | ) |
Definition at line 304 of file font_diskfont.c.
References prev_font, and prev_fstyle.
Referenced by ami_font_fini().
void ami_font_diskfont_init | ( | void | ) |
Definition at line 292 of file font_diskfont.c.
References ami_font_diskfont_table, ami_nsfont, prev_fstyle, and temp_rp.
Referenced by ami_font_init().
|
static |
Find the position in a string where an x coordinate falls.
fstyle | style for this text |
string | UTF-8 string to measure |
length | length of string |
x | x coordinate to search for |
char_offset | updated to offset in string of actual_x, [0..length] |
actual_x | updated to x coordinate of character closest to x |
Definition at line 166 of file font_diskfont.c.
References ami_font_bm_convert_local_to_utf8_offset(), ami_font_bm_open(), NSERROR_INVALID, NSERROR_OK, temp_rp, and utf8_to_local_encoding().
|
static |
Find where to split a string to make it fit a width.
fstyle | style for this text |
string | UTF-8 string to measure |
length | length of string |
x | width available |
char_offset | updated to offset in string of actual_x, [1..length] |
actual_x | updated to x coordinate of character closest to x |
On exit, char_offset indicates first character after split point.
Note: char_offset of 0 should never be returned.
Returns: char_offset giving split point closest to x, where actual_x <= x else char_offset giving split point closest to x, where actual_x > x
Returning char_offset == length means no split possible
Definition at line 216 of file font_diskfont.c.
References ami_font_bm_convert_local_to_utf8_offset(), ami_font_bm_open(), NSERROR_INVALID, NSERROR_OK, temp_rp, and utf8_to_local_encoding().
|
static |
Definition at line 266 of file font_diskfont.c.
References ami_font_bm_open(), NSERROR_OK, and utf8_to_local_encoding().
|
static |
Definition at line 133 of file font_diskfont.c.
References ami_font_bm_open(), NSERROR_INVALID, NSERROR_OK, temp_rp, utf8_to_local_encoding(), and width.
const struct ami_font_functions ami_font_diskfont_table |
Definition at line 285 of file font_diskfont.c.
Referenced by ami_font_diskfont_init().
|
static |
Definition at line 43 of file font_diskfont.c.
Referenced by ami_font_bm_open(), and ami_font_diskfont_fini().
|
static |
Definition at line 42 of file font_diskfont.c.
Referenced by ami_font_bm_open(), ami_font_diskfont_fini(), and ami_font_diskfont_init().
|
static |
Definition at line 44 of file font_diskfont.c.
Referenced by ami_font_diskfont_init(), amiga_bm_nsfont_position_in_string(), amiga_bm_nsfont_split(), and amiga_bm_nsfont_width().