NetSurf
|
monkey implementation of font layout. More...
#include <stddef.h>
#include "utils/utf8.h"
#include "netsurf/plot_style.h"
#include "netsurf/layout.h"
#include "monkey/layout.h"
Go to the source code of this file.
Functions | |
static nserror | nsfont_width (const plot_font_style_t *fstyle, const char *string, size_t length, int *width) |
static nserror | 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 | 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... | |
Variables | |
static struct gui_layout_table | layout_table |
struct gui_layout_table * | monkey_layout_table = &layout_table |
monkey implementation of font layout.
Definition in file layout.c.
|
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 52 of file layout.c.
References NSERROR_OK, PLOT_STYLE_SCALE, and plot_font_style::size.
|
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, in bytes |
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 87 of file layout.c.
References NSERROR_OK, PLOT_STYLE_SCALE, and plot_font_style::size.
|
static |
Definition at line 32 of file layout.c.
References NSERROR_OK, PLOT_STYLE_SCALE, plot_font_style::size, utf8_bounded_length(), and width.
|
static |
struct gui_layout_table* monkey_layout_table = &layout_table |