21#include <proto/diskfont.h>
22#include <proto/exec.h>
23#include <proto/graphics.h>
50 DisplayInfoHandle dih;
51 struct DisplayInfo dinfo;
55 "WARNING: Using diskfont.library for text. Forcing DPI to 72.");
65 if((dih = FindDisplayInfo(
id)))
67 if(GetDisplayInfoData(dih, &dinfo,
sizeof(
struct DisplayInfo),
70 int xres = dinfo.Resolution.x;
71 int yres = dinfo.Resolution.y;
81 xdpi = (yres * ydpi) / xres;
84 "XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x %d)",
103 struct TextFont *tfont = OpenDiskFont(tattr);
133 const char *
string,
size_t length,
136 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
141 const char *
string,
size_t length,
142 int x,
size_t *char_offset,
int *actual_x)
144 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
145 return ami_nsfont->
posn(fstyle,
string, length, x, char_offset, actual_x);
149 const char *
string,
size_t length,
150 int x,
size_t *char_offset,
int *actual_x)
152 if(__builtin_expect(
ami_nsfont == NULL, 0))
return false;
153 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)
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)
const struct ami_font_functions * ami_nsfont
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_int(OPTION)
Get the value of an integer option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.