summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 10:48:36 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 10:48:36 +0100
commit34154ebb99c9ce199e6c9c9ed5993e017023c697 (patch)
treeadb2f8796762704d9f2a2ba587ac4f102a634715 /amiga
parent1ceced6e673cd9e573bd1a0475fa8357296b3289 (diff)
downloadnetsurf-34154ebb99c9ce199e6c9c9ed5993e017023c697.tar.gz
netsurf-34154ebb99c9ce199e6c9c9ed5993e017023c697.tar.bz2
Disable anti-aliasing for palette-mapped modes
Diffstat (limited to 'amiga')
-rw-r--r--amiga/font.c34
-rwxr-xr-xamiga/font.h2
-rwxr-xr-xamiga/plotters.c2
3 files changed, 24 insertions, 14 deletions
diff --git a/amiga/font.c b/amiga/font.c
index 19d6dd1f0..ffecf85fe 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -79,7 +79,7 @@ ULONG ami_devicedpi;
ULONG ami_xdpi;
int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
- uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth);
+ uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth, bool aa);
int32 ami_font_width_glyph(struct OutlineFont *ofont,
uint16 char1, uint16 char2, uint32 emwidth);
struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
@@ -108,7 +108,7 @@ bool nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
{
- *width = ami_unicode_text(NULL,string,length,fstyle,0,0);
+ *width = ami_unicode_text(NULL, string, length, fstyle, 0, 0, false);
if(*width <= 0) *width == length; // fudge
@@ -517,20 +517,27 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle,
}
int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
- uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth)
+ uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth, bool aa)
{
struct GlyphMap *glyph;
UBYTE *glyphbm;
int32 char_advance = 0;
FIXED kern = 0;
-
+ ULONG glyphmaptag = OT_GlyphMap8Bit;
+ ULONG template_type = BLITT_ALPHATEMPLATE;
+
+ if(aa == false) {
+ glyphmaptag = OT_GlyphMap;
+ template_type = BLITT_TEMPLATE;
+ }
+
if(ESetInfo(&ofont->olf_EEngine,
OT_GlyphCode, char1,
OT_GlyphCode2, char2,
TAG_END) == OTERR_Success)
{
if(EObtainInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,&glyph,
+ glyphmaptag, &glyph,
TAG_END) == 0)
{
glyphbm = glyph->glm_BitMap;
@@ -545,7 +552,7 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
BLITA_Width, glyph->glm_BlackWidth,
BLITA_Height, glyph->glm_BlackHeight,
BLITA_Source, glyphbm,
- BLITA_SrcType, BLITT_ALPHATEMPLATE,
+ BLITA_SrcType, template_type,
BLITA_Dest, rp,
BLITA_DestType, BLITT_RASTPORT,
BLITA_SrcBytesPerRow, glyph->glm_BMModulo,
@@ -561,7 +568,7 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
char_advance = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
EReleaseInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,glyph,
+ glyphmaptag, glyph,
TAG_END);
}
}
@@ -691,7 +698,8 @@ uint16 ami_font_translate_smallcaps(uint16 utf16char)
return utf16char;
}
-ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const plot_font_style_t *fstyle,ULONG dx, ULONG dy)
+ULONG ami_unicode_text(struct RastPort *rp, const char *string, ULONG length,
+ const plot_font_style_t *fstyle, ULONG dx, ULONG dy, bool aa)
{
uint16 *utf16 = NULL, *outf16 = NULL;
uint16 utf16charsc = 0, utf16nextsc = 0;
@@ -727,7 +735,8 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
utf16nextsc = ami_font_translate_smallcaps(utf16next);
if(rp) {
- tempx = ami_font_plot_glyph(ofont, rp, utf16charsc, utf16nextsc, dx + x, dy, emwidth);
+ tempx = ami_font_plot_glyph(ofont, rp, utf16charsc, utf16nextsc,
+ dx + x, dy, emwidth, aa);
} else {
tempx = ami_font_width_glyph(ofont, utf16charsc, utf16nextsc, emwidth);
}
@@ -736,7 +745,8 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
if(tempx == 0) {
if(rp) {
- tempx = ami_font_plot_glyph(ofont, rp, *utf16, utf16next, dx + x, dy, emwidth);
+ tempx = ami_font_plot_glyph(ofont, rp, *utf16, utf16next,
+ dx + x, dy, emwidth, aa);
} else {
tempx = ami_font_width_glyph(ofont, *utf16, utf16next, emwidth);
}
@@ -753,7 +763,7 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
{
if(rp) {
tempx = ami_font_plot_glyph(ufont, rp, *utf16, utf16next,
- dx + x, dy, emwidth);
+ dx + x, dy, emwidth, aa);
} else {
tempx = ami_font_width_glyph(ufont, *utf16, utf16next, emwidth);
}
@@ -763,7 +773,7 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
{
if(rp) {
tempx = ami_font_plot_glyph(ofont, rp, 0xfffd, utf16next,
- dx + x, dy, emwidth);
+ dx + x, dy, emwidth, aa);
} else {
tempx = ami_font_width_glyph(ofont, 0xfffd, utf16next, emwidth);
}
diff --git a/amiga/font.h b/amiga/font.h
index 36bdbf9ef..10137f777 100755
--- a/amiga/font.h
+++ b/amiga/font.h
@@ -26,7 +26,7 @@
struct ami_font_node;
ULONG ami_unicode_text(struct RastPort *rp, const char *string,
- ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y);
+ ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
void ami_font_setdevicedpi(int id);
void ami_init_fonts(void);
void ami_close_fonts(void);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index e69e05618..c581711b0 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -521,7 +521,7 @@ bool ami_text(int x, int y, const char *text, size_t length,
#endif
ami_plot_setapen(fstyle->foreground);
- ami_unicode_text(glob->rp,text,length,fstyle,x,y);
+ ami_unicode_text(glob->rp, text, length, fstyle, x, y, !palette_mapped);
return true;
}