21#include <proto/diskfont.h>
22#include <proto/exec.h>
23#include <proto/graphics.h>
52 DisplayInfoHandle dih;
53 struct DisplayInfo dinfo;
61 if((dih = FindDisplayInfo(
id)))
63 if(GetDisplayInfoData(dih, &dinfo,
sizeof(
struct DisplayInfo),
66 int xres = dinfo.Resolution.x;
67 int yres = dinfo.Resolution.y;
77 xdpi = (yres * ydpi) / xres;
80 "XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)",
99 struct TextFont *tfont = OpenDiskFont(tattr);
151 const char *
string,
size_t length,
154 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
159 const char *
string,
size_t length,
160 int x,
size_t *char_offset,
int *actual_x)
162 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
163 return ami_nsfont->
posn(fstyle,
string, length, x, char_offset, actual_x);
167 const char *
string,
size_t length,
168 int x,
size_t *char_offset,
int *actual_x)
170 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
171 return ami_nsfont->
split(fstyle,
string, length, x, char_offset, actual_x);
nserror
Enumeration of error codes.
void ami_font_bullet_fini(void)
void ami_font_bullet_init(void)
void ami_font_diskfont_init(void)
void ami_font_diskfont_fini(void)
static ULONG ami_devicedpi
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)
ULONG ami_font_dpi_get_devicedpi(void)
struct ami_font_functions * ami_nsfont
ULONG ami_font_dpi_get_xdpi(void)
struct TextFont * ami_font_open_disk_font(struct TextAttr *tattr)
void ami_font_close_disk_font(struct TextFont *tfont)
struct gui_layout_table * ami_layout_table
static struct gui_layout_table layout_table
void ami_font_setdevicedpi(int id)
static nserror ami_font_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width)
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)
nserror browser_set_dpi(int dpi)
Set the DPI of the browser.
Interface to platform-specific layout operation table.
#define NSLOG(catname, level, logmsg, args...)
Minimal compatibility header for AmigaOS 3.
nserror(* posn)(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
nserror(* width)(const plot_font_style_t *fstyle, const char *string, size_t length, int *width)
nserror(* split)(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
nserror(* width)(const struct plot_font_style *fstyle, const char *string, size_t length, int *width)
Measure the width of a string.
Option reading and saving interface.
#define nsoption_setnull_charp(OPTION, VALUE)
set string option in default table if currently unset
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_bool(OPTION)
Get the value of a boolean option.