NetSurf
Functions | Variables
font.h File Reference
#include "framebuffer/font_internal.h"
Include dependency graph for font.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool fb_font_init (void)
 Initialise framebuffer font handling. More...
 
bool fb_font_finalise (void)
 Finalise framebuffer font handling. More...
 
nserror fb_font_position (const struct plot_font_style *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...
 
nserror fb_font_width (const struct plot_font_style *fstyle, const char *string, size_t length, int *width)
 Measure the width of a string. More...
 

Variables

struct gui_layout_tableframebuffer_layout_table
 
struct gui_utf8_tableframebuffer_utf8_table
 

Function Documentation

◆ fb_font_finalise()

bool fb_font_finalise ( void  )

Finalise framebuffer font handling.

Definition at line 316 of file font_freetype.c.

References FB_FACE_COUNT, fb_faces, ft_cmanager, and library.

Referenced by main().

Here is the caller graph for this function:

◆ fb_font_init()

bool fb_font_init ( void  )

Initialise framebuffer font handling.

Definition at line 147 of file font_freetype.c.

References CACHE_MIN_SIZE, FB_FACE_CURSIVE, FB_FACE_FANTASY, FB_FACE_MONOSPACE, FB_FACE_MONOSPACE_BOLD, FB_FACE_SANS_SERIF, FB_FACE_SANS_SERIF_BOLD, FB_FACE_SANS_SERIF_ITALIC, FB_FACE_SANS_SERIF_ITALIC_BOLD, FB_FACE_SERIF, FB_FACE_SERIF_BOLD, fb_faces, fb_new_face(), ft_cmanager, ft_cmap_cache, ft_face_requester(), ft_image_cache, ft_load_type, library, NSLOG, nsoption_bool, nsoption_charp, and nsoption_int.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_font_position()

nserror fb_font_position ( const struct plot_font_style 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.

Parameters
[in]fstylestyle for this text
[in]stringUTF-8 string to measure
[in]lengthlength of string, in bytes
[in]xcoordinate to search for
[out]char_offsetupdated to offset in string of actual_x, [0..length]
[out]actual_xupdated to x coordinate of character closest to x
Returns
NSERROR_OK and char_offset and actual_x updated or appropriate error code on faliure

Referenced by text_input_click().

Here is the caller graph for this function:

◆ fb_font_width()

nserror fb_font_width ( const struct plot_font_style fstyle,
const char *  string,
size_t  length,
int *  width 
)

Measure the width of a string.

Parameters
[in]fstyleplot style for this text
[in]stringUTF-8 string to measure
[in]lengthlength of string, in bytes
[out]widthupdated to width of string[0..length)
Returns
NSERROR_OK and width updated or appropriate error code on faliure

Referenced by fbtk_set_text(), and text_input().

Here is the caller graph for this function:

Variable Documentation

◆ framebuffer_layout_table

struct gui_layout_table* framebuffer_layout_table
extern

Definition at line 562 of file font_freetype.c.

Referenced by main().

◆ framebuffer_utf8_table

struct gui_utf8_table* framebuffer_utf8_table
extern

Definition at line 565 of file font_freetype.c.

Referenced by main().