NetSurf
|
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include "netsurf/inttypes.h"
#include "utils/utf8.h"
#include "utils/log.h"
#include "utils/nsoption.h"
#include "netsurf/layout.h"
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
#include "atari/gui.h"
#include "atari/plot/fontplot.h"
#include "atari/plot/plot.h"
#include "atari/findfile.h"
#include "atari/font.h"
Go to the source code of this file.
Functions | |
static nserror | atari_font_position (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 | atari_font_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 nserror | atari_font_width (const plot_font_style_t *fstyle, const char *str, size_t length, int *width) |
Measure the width of a string. More... | |
Variables | |
FONT_PLOTTER | fplotter |
static struct gui_layout_table | layout_table |
struct gui_layout_table * | atari_layout_table = &layout_table |
|
static |
Find the position in a string where an x coordinate falls.
[in] | fstyle | style for this text |
[in] | string | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[in] | x | coordinate to search for |
[out] | char_offset | updated to offset in string of actual_x, [0..length] |
[out] | actual_x | updated to x coordinate of character closest to x |
Definition at line 52 of file font.c.
References fplotter, NSERROR_OK, s_font_plotter::pixel_pos, plot_get_scale(), and plot_font_style::size.
|
static |
Find where to split a string to make it fit a width.
[in] | fstyle | style for this text |
[in] | string | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[in] | x | width available |
[out] | char_offset | updated to offset in string of actual_x, [1..length] |
[out] | actual_x | updated to x coordinate of character closest to x |
On exit, char_offset indicates first character after split point.
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 98 of file font.c.
References fplotter, NSERROR_OK, plot_get_scale(), plot_font_style::size, and s_font_plotter::str_split.
|
static |
Measure the width of a string.
[in] | fstyle | plot style for this text |
[in] | str | UTF-8 string to measure |
[in] | length | length of string, in bytes |
[out] | width | updated to width of string[0..length) |
Definition at line 131 of file font.c.
References fplotter, NSERROR_OK, plot_get_scale(), plot_font_style::size, s_font_plotter::str_width, and width.
struct gui_layout_table* atari_layout_table = &layout_table |
|
extern |
Definition at line 165 of file plot.c.
Referenced by atari_font_position(), atari_font_split(), atari_font_width(), new_font_plotter(), plot_finalise(), plot_get_text_plotter(), plot_init(), plot_set_text_plotter(), and plot_text().
|
static |