diff --git a/amiga/font.c b/amiga/font.c index 39cb38602..1c9702af2 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -25,7 +25,7 @@ #include "utils/log.h" #include "utils/nsoption.h" #include "desktop/browser.h" -#include "desktop/font.h" +#include "desktop/gui_layout.h" #include "amiga/font.h" #include "amiga/font_bullet.h" @@ -119,7 +119,7 @@ void ami_font_fini(void) } /* Stub entry points */ -static bool nsfont_width(const plot_font_style_t *fstyle, +static nserror ami_font_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width) { @@ -127,7 +127,7 @@ static bool nsfont_width(const plot_font_style_t *fstyle, return ami_nsfont->width(fstyle, string, length, width); } -static bool nsfont_position_in_string(const plot_font_style_t *fstyle, +static nserror ami_font_position(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { @@ -135,7 +135,7 @@ static bool nsfont_position_in_string(const plot_font_style_t *fstyle, return ami_nsfont->posn(fstyle, string, length, x, char_offset, actual_x); } -static bool nsfont_split(const plot_font_style_t *fstyle, +static nserror ami_font_split(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { @@ -143,9 +143,10 @@ static bool nsfont_split(const plot_font_style_t *fstyle, return ami_nsfont->split(fstyle, string, length, x, char_offset, actual_x); } -const struct font_functions nsfont = { - nsfont_width, - nsfont_position_in_string, - nsfont_split +static struct gui_layout_table layout_table = { + .width = ami_font_width, + .position = ami_font_position, + .split = ami_font_split, }; +struct gui_layout_table *ami_layout_table = &layout_table; diff --git a/amiga/font.h b/amiga/font.h index da23b5989..a0b63d060 100755 --- a/amiga/font.h +++ b/amiga/font.h @@ -55,5 +55,8 @@ struct ami_font_functions { }; const struct ami_font_functions *ami_nsfont; + +struct gui_layout_table *ami_layout_table; + #endif diff --git a/amiga/font_diskfont.c b/amiga/font_diskfont.c index 6ad6e79c4..91bec20d3 100644 --- a/amiga/font_diskfont.c +++ b/amiga/font_diskfont.c @@ -30,7 +30,6 @@ #include "utils/log.h" #include "utils/utf8.h" #include "utils/nsoption.h" -#include "desktop/font.h" #include "amiga/font.h" #include "amiga/font_diskfont.h" diff --git a/amiga/print.c b/amiga/print.c index 72b83e8e3..908b026e6 100644 --- a/amiga/print.c +++ b/amiga/print.c @@ -50,12 +50,13 @@ #include "utils/messages.h" #include "utils/utils.h" #include "desktop/printer.h" -#include "desktop/font.h" +#include "desktop/gui_layout.h" #include "desktop/mouse.h" #include "desktop/gui_window.h" #include "content/hlcache.h" #include "amiga/plotters.h" +#include "amiga/font.h" #include "amiga/gui.h" #include "amiga/libs.h" #include "amiga/misc.h" @@ -414,7 +415,7 @@ void ami_print(struct hlcache_handle *c, int copies) ami_print_info.PD = (struct PrinterData *)ami_print_info.PReq->io_Device; ami_print_info.PED = &ami_print_info.PD->pd_SegmentData->ps_PED; - ami_print_info.ps = print_make_settings(PRINT_DEFAULT, nsurl_access(hlcache_handle_get_url(c)), &nsfont); + ami_print_info.ps = print_make_settings(PRINT_DEFAULT, nsurl_access(hlcache_handle_get_url(c)), ami_layout_table); ami_print_info.ps->page_width = ami_print_info.PED->ped_MaxXDots; ami_print_info.ps->page_height = ami_print_info.PED->ped_MaxYDots; ami_print_info.ps->scale = scale;