misc amiga fixes re font plotting

This commit is contained in:
Chris Young 2016-01-17 23:40:50 +00:00
parent 132be1eed2
commit b3aa313e84
4 changed files with 10 additions and 13 deletions

View File

@ -36,14 +36,14 @@ void ami_font_setdevicedpi(int id)
{
DisplayInfoHandle dih;
struct DisplayInfo dinfo;
ULONG ydpi = nsoption_int(screen_ydpi);
ULONG xdpi = nsoption_int(screen_ydpi);
if(nsoption_bool(bitmap_fonts) == true) {
LOG("WARNING: Using diskfont.library for text. Forcing DPI to 72.");
nsoption_set_int(screen_ydpi, 72);
}
ULONG ydpi = nsoption_int(screen_ydpi);
ULONG xdpi = nsoption_int(screen_ydpi);
browser_set_dpi(nsoption_int(screen_ydpi));
if(id && (nsoption_int(monitor_aspect_x) != 0) && (nsoption_int(monitor_aspect_y) != 0))

View File

@ -23,8 +23,6 @@
#include <graphics/rastport.h>
#include <graphics/text.h>
struct ami_font_cache_node;
void ami_font_setdevicedpi(int id);
void ami_font_init(void);
void ami_font_fini(void);

View File

@ -155,7 +155,7 @@ static inline uint32 amiga_nsfont_decode_surrogate(const uint16 *char1)
}
}
static inline bool amiga_nsfont_width(const plot_font_style_t *fstyle,
static bool amiga_nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
{
@ -178,7 +178,7 @@ static inline bool amiga_nsfont_width(const plot_font_style_t *fstyle,
* \return true on success, false on error and error reported
*/
static inline bool amiga_nsfont_position_in_string(const plot_font_style_t *fstyle,
static bool amiga_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)
{
@ -261,7 +261,7 @@ static inline bool amiga_nsfont_position_in_string(const plot_font_style_t *fsty
* Returning char_offset == length means no split possible
*/
static inline bool amiga_nsfont_split(const plot_font_style_t *fstyle,
static bool amiga_nsfont_split(const plot_font_style_t *fstyle,
const char *string, size_t length,
int x, size_t *char_offset, int *actual_x)
{

View File

@ -94,7 +94,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
* Height is set to screen width to give enough space for thumbnails *
* Also applies to the further gfx/layers functions and memory below */
ULONG depth = 32;
int depth = 32;
struct BitMap *friend = NULL;
depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
@ -112,6 +112,8 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
if(depth > 8) depth = 8;
#endif
if(palette_mapped == true) nsoption_set_bool(font_antialiasing, false);
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
gg->width = width;
@ -429,13 +431,10 @@ static bool ami_text(int x, int y, const char *text, size_t length,
LOG("[ami_plotter] Entered ami_text()");
#endif
bool aa = true;
if((nsoption_bool(font_antialiasing) == false) || (palette_mapped == true))
aa = false;
if(__builtin_expect(ami_nsfont == NULL, 0)) return false;
ami_plot_setapen(glob->rp, fstyle->foreground);
ami_nsfont->text(glob->rp, text, length, fstyle, x, y, aa);
ami_nsfont->text(glob->rp, text, length, fstyle, x, y, nsoption_bool(font_antialiasing));
return true;
}