summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-05-06 10:02:58 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-05-06 10:02:58 +0000
commitf55c11dbd6cb3242570eeb022b772ec236fe8603 (patch)
treeb9ba462d15bb7f68c65d8727c214e4c0ee8e6787
parent0807b405139259e719115b99755cc4a6153542f6 (diff)
downloadnetsurf-f55c11dbd6cb3242570eeb022b772ec236fe8603.tar.gz
netsurf-f55c11dbd6cb3242570eeb022b772ec236fe8603.tar.bz2
Amiga font code revamped and fixed. Will now fall back to a different font if the
character isn't present in the current one, this needs a complete or near-complete Unicode font in order to be useful - Code2000 and Bitstream Cyberbit are auto-detected by NetSurf on startup if none is configured. Japanese websites now display correctly, along with Japanese characters within Google UK search results etc. svn path=/trunk/netsurf/; revision=10551
-rw-r--r--!NetSurf/Resources/de/Messages1
-rw-r--r--!NetSurf/Resources/en/Messages1
-rw-r--r--!NetSurf/Resources/fr/Messages1
-rwxr-xr-x!NetSurf/Resources/it/Messages1
-rw-r--r--!NetSurf/Resources/nl/Messages1
-rw-r--r--amiga/font.c309
-rwxr-xr-xamiga/gui.c18
-rwxr-xr-xamiga/gui_options.c28
-rw-r--r--amiga/options.h5
9 files changed, 236 insertions, 129 deletions
diff --git a/!NetSurf/Resources/de/Messages b/!NetSurf/Resources/de/Messages
index 6faa52ce1..340614448 100644
--- a/!NetSurf/Resources/de/Messages
+++ b/!NetSurf/Resources/de/Messages
@@ -1352,6 +1352,7 @@ FontSerif:Serif
FontMono:Monospace
FontCursive:Kursiv
FontFantasy:Fantasy
+FontFallback:Fallback (Unicode)
Default:Standard
FontSize:Schriftgröße
Minimum:Minimum
diff --git a/!NetSurf/Resources/en/Messages b/!NetSurf/Resources/en/Messages
index 3f9107a45..45152b2ff 100644
--- a/!NetSurf/Resources/en/Messages
+++ b/!NetSurf/Resources/en/Messages
@@ -1357,6 +1357,7 @@ FontSerif:Serif
FontMono:Monospaced
FontCursive:Cursive
FontFantasy:Fantasy
+FontFallback:Fallback (Unicode)
Default:Default
FontSize:Font size
Minimum:Minimum
diff --git a/!NetSurf/Resources/fr/Messages b/!NetSurf/Resources/fr/Messages
index 0c0bac28e..fa49a61be 100644
--- a/!NetSurf/Resources/fr/Messages
+++ b/!NetSurf/Resources/fr/Messages
@@ -1358,6 +1358,7 @@ FontSerif:Serif
FontMono:Monospaced
FontCursive:Cursive
FontFantasy:Fantasy
+FontFallback:Fallback (Unicode)
Default:Default
FontSize:Font size
Minimum:Minimum
diff --git a/!NetSurf/Resources/it/Messages b/!NetSurf/Resources/it/Messages
index b09ea1f6e..a10f58a8f 100755
--- a/!NetSurf/Resources/it/Messages
+++ b/!NetSurf/Resources/it/Messages
@@ -1358,6 +1358,7 @@ FontSerif:Serif
FontMono:Monospaziato
FontCursive:Corsivo
FontFantasy:Fantasia
+FontFallback:Fallback (Unicode)
Default:Predefinito
FontSize:Dimensione Font
Minimum:Minimo
diff --git a/!NetSurf/Resources/nl/Messages b/!NetSurf/Resources/nl/Messages
index 47e58c1b5..82e1d40b4 100644
--- a/!NetSurf/Resources/nl/Messages
+++ b/!NetSurf/Resources/nl/Messages
@@ -1353,6 +1353,7 @@ FontSerif:Serif
FontMono:Monospaced
FontCursive:Cursive
FontFantasy:Fantasy
+FontFallback:Fallback (Unicode)
Default:Default
FontSize:Font size
Minimum:Minimum
diff --git a/amiga/font.c b/amiga/font.c
index b66343e15..c62350cee 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -36,12 +36,16 @@
#include <proto/utility.h>
#include "utils/utils.h"
-static struct OutlineFont *of[PLOT_FONT_FAMILY_COUNT];
-static struct OutlineFont *ofb[PLOT_FONT_FAMILY_COUNT];
-static struct OutlineFont *ofi[PLOT_FONT_FAMILY_COUNT];
-static struct OutlineFont *ofbi[PLOT_FONT_FAMILY_COUNT];
+#define NSA_UNICODE_FONT PLOT_FONT_FAMILY_COUNT
-struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle);
+static struct OutlineFont *of[PLOT_FONT_FAMILY_COUNT+1];
+static struct OutlineFont *ofb[PLOT_FONT_FAMILY_COUNT+1];
+static struct OutlineFont *ofi[PLOT_FONT_FAMILY_COUNT+1];
+static struct OutlineFont *ofbi[PLOT_FONT_FAMILY_COUNT+1];
+
+int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
+ uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth);
+struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle, BOOL fallback);
static bool nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
@@ -65,10 +69,10 @@ bool nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
{
- struct TextFont *tfont;
-
*width = ami_unicode_text(NULL,string,length,fstyle,0,0);
+ if(*width <= 0) *width == length; // fudge
+
return true;
}
@@ -93,7 +97,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
uint16 *utf16 = NULL, *outf16 = NULL;
uint16 utf16next = NULL;
FIXED kern = 0;
- struct OutlineFont *ofont;
+ struct OutlineFont *ofont, *ufont = NULL;
struct GlyphMap *glyph;
uint32 tx=0,i=0;
size_t len, utf8len = 0;
@@ -101,13 +105,13 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
uint32 co = 0;
int utf16charlen;
ULONG emwidth = (ULONG)((fstyle->size / FONT_SIZE_SCALE) * glob->scale);
- ULONG charwidth;
+ int32 tempx;
len = utf8_bounded_length(string, length);
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle))) return false;
+ if(!(ofont = ami_open_outline_font(fstyle, FALSE))) return false;
*char_offset = length;
@@ -122,41 +126,41 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
utf16next = utf16[utf16charlen];
- if(ESetInfo(&ofont->olf_EEngine,
- OT_GlyphCode, *utf16,
- OT_GlyphCode2, utf16next,
- TAG_END) == OTERR_Success)
+ tempx = ami_font_plot_glyph(ofont, NULL, *utf16, utf16next,
+ 0, 0, emwidth);
+
+ if(tempx == 0)
{
- if(EObtainInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,&glyph,
- TAG_END) == 0)
+ if(ufont == NULL)
{
- kern = 0;
-
- if(utf16next) EObtainInfo(&ofont->olf_EEngine,
- OT_TextKernPair, &kern,
- TAG_END);
-
- charwidth = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
-
- if(x < (tx + charwidth))
- {
- *actual_x = tx;
- i = len+1;
- }
- else
- {
- co += utf8len;
- }
-
- tx += charwidth;
+ ufont = ami_open_outline_font(fstyle, TRUE);
+ }
- EReleaseInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,glyph,
- TAG_END);
+ if(ufont)
+ {
+ tempx = ami_font_plot_glyph(ufont, NULL, *utf16, utf16next,
+ 0, 0, emwidth);
+ }
+/*
+ if(tempx == 0)
+ {
+ tempx = ami_font_plot_glyph(ofont, NULL, 0xfffd, utf16next,
+ 0, 0, emwidth);
}
+*/
}
+ if(x < (tx + tempx))
+ {
+ *actual_x = tx;
+ i = len+1;
+ }
+ else
+ {
+ co += utf8len;
+ }
+
+ tx += tempx;
string += utf8len;
utf16 += utf16charlen;
}
@@ -203,17 +207,18 @@ bool nsfont_split(const plot_font_style_t *fstyle,
uint16 utf16next = 0;
FIXED kern = 0;
int utf16charlen = 0;
- struct OutlineFont *ofont;
+ struct OutlineFont *ofont, *ufont = NULL;
struct GlyphMap *glyph;
uint32 tx=0,i=0;
size_t len;
int utf8len, utf8clen = 0;
+ int32 tempx = 0;
ULONG emwidth = (ULONG)((fstyle->size / FONT_SIZE_SCALE) * glob->scale);
len = utf8_bounded_length(string, length);
if(utf8_to_enc((char *)string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return false;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle))) return false;
+ if(!(ofont = ami_open_outline_font(fstyle, FALSE))) return false;
*char_offset = 0;
*actual_x = 0;
@@ -229,36 +234,43 @@ bool nsfont_split(const plot_font_style_t *fstyle,
utf16next = utf16[utf16charlen];
- if(ESetInfo(&ofont->olf_EEngine,
- OT_GlyphCode, *utf16,
- OT_GlyphCode2, utf16next,
- TAG_END) == OTERR_Success)
+ if(x < tx)
+ {
+ i = length+1;
+ }
+ else
+ {
+ if(string[utf8clen] == ' ') //*utf16 == 0x0020)
+ {
+ *actual_x = tx;
+ *char_offset = utf8clen;
+ }
+ }
+
+ tempx = ami_font_plot_glyph(ofont, NULL, *utf16, utf16next, 0, 0, emwidth);
+
+ if(tempx == 0)
{
- if(EObtainInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,&glyph,
- TAG_END) == 0)
+ if(ufont == NULL)
+ {
+ ufont = ami_open_outline_font(fstyle, TRUE);
+ }
+
+ if(ufont)
{
- if(x < tx)
- {
- i = length+1;
- }
- else
- {
- if(string[utf8clen] == ' ') //*utf16 == 0x0020)
- {
- *actual_x = tx;
- *char_offset = utf8clen;
- }
- }
-
- tx += (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
-
- EReleaseInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,glyph,
- TAG_END);
+ tempx = ami_font_plot_glyph(ufont, NULL, *utf16, utf16next,
+ 0, 0, emwidth);
}
+/*
+ if(tempx == 0)
+ {
+ tempx = ami_font_plot_glyph(ofont, NULL, 0xfffd, utf16next,
+ 0, 0, emwidth);
+ }
+*/
}
+ tx += tempx;
utf16 += utf16charlen;
utf8clen += utf8len;
}
@@ -268,12 +280,23 @@ bool nsfont_split(const plot_font_style_t *fstyle,
return true;
}
-struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle)
+/**
+ * Open an outline font in the specified size and style
+ *
+ * \param fstyle font style structure
+ * \param default open a default font instead of the one specified by fstyle
+ * \return outline font or NULL on error
+ */
+struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle, BOOL fallback)
{
struct OutlineFont *ofont;
char *fontname;
ULONG ysize;
int tstyle = 0;
+ plot_font_generic_family_t fontfamily;
+
+ if(fallback) fontfamily = NSA_UNICODE_FONT;
+ else fontfamily = fstyle->family;
if ((fstyle->flags & FONTF_ITALIC) || (fstyle->flags & FONTF_OBLIQUE))
tstyle += NSA_ITALIC;
@@ -284,22 +307,22 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle)
switch(tstyle)
{
case NSA_ITALIC:
- if(ofi[fstyle->family]) ofont = ofi[fstyle->family];
- else ofont = of[fstyle->family];
+ if(ofi[fontfamily]) ofont = ofi[fontfamily];
+ else ofont = of[fontfamily];
break;
case NSA_BOLD:
- if(ofb[fstyle->family]) ofont = ofb[fstyle->family];
- else ofont = of[fstyle->family];
+ if(ofb[fontfamily]) ofont = ofb[fontfamily];
+ else ofont = of[fontfamily];
break;
case NSA_BOLDITALIC:
- if(ofbi[fstyle->family]) ofont = ofbi[fstyle->family];
- else ofont = of[fstyle->family];
+ if(ofbi[fontfamily]) ofont = ofbi[fontfamily];
+ else ofont = of[fontfamily];
break;
default:
- ofont = of[fstyle->family];
+ ofont = of[fontfamily];
break;
}
@@ -317,38 +340,82 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle)
return NULL;
}
+int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp,
+ uint16 char1, uint16 char2, uint32 x, uint32 y, uint32 emwidth)
+{
+ struct GlyphMap *glyph;
+ UBYTE *glyphbm;
+ int32 char_advance = 0;
+ FIXED kern = 0;
+
+ if(ESetInfo(&ofont->olf_EEngine,
+ OT_GlyphCode, char1,
+ OT_GlyphCode2, char2,
+ TAG_END) == OTERR_Success)
+ {
+ if(EObtainInfo(&ofont->olf_EEngine,
+ OT_GlyphMap8Bit,&glyph,
+ TAG_END) == 0)
+ {
+ glyphbm = glyph->glm_BitMap;
+ if(!glyphbm) return 0;
+
+ if(rp)
+ {
+ BltBitMapTags(BLITA_SrcX, glyph->glm_BlackLeft,
+ BLITA_SrcY, glyph->glm_BlackTop,
+ BLITA_DestX, x - glyph->glm_X0 + glyph->glm_BlackLeft,
+ BLITA_DestY, y - glyph->glm_Y0 + glyph->glm_BlackTop,
+ BLITA_Width, glyph->glm_BlackWidth,
+ BLITA_Height, glyph->glm_BlackHeight,
+ BLITA_Source, glyphbm,
+ BLITA_SrcType, BLITT_ALPHATEMPLATE,
+ BLITA_Dest, rp,
+ BLITA_DestType, BLITT_RASTPORT,
+ BLITA_SrcBytesPerRow, glyph->glm_BMModulo,
+ TAG_DONE);
+ }
+
+ kern = 0;
+
+ if(char2) EObtainInfo(&ofont->olf_EEngine,
+ OT_TextKernPair, &kern,
+ TAG_END);
+
+ char_advance = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
+
+ EReleaseInfo(&ofont->olf_EEngine,
+ OT_GlyphMap8Bit,glyph,
+ TAG_END);
+ }
+ }
+
+ return char_advance;
+}
+
ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const plot_font_style_t *fstyle,ULONG dx, ULONG dy)
{
uint16 *utf16 = NULL, *outf16 = NULL;
uint16 utf16next = 0;
int utf16charlen;
- FIXED kern = 0;
- struct OutlineFont *ofont;
- struct GlyphMap *glyph;
+ struct OutlineFont *ofont, *ufont = NULL;
ULONG i,gx,gy;
- UBYTE *glyphbm;
UWORD posn;
- struct BitMap *tbm;
- struct RastPort trp;
- uint32 width,height;
- uint32 x=0,y=0;
- size_t len;
+ uint32 x=0;
uint8 co = 0;
+ int32 tempx = 0;
ULONG emwidth = (ULONG)((fstyle->size / FONT_SIZE_SCALE) * glob->scale);
if(!string || string[0]=='\0') return 0;
if(!length) return 0;
- len = utf8_bounded_length(string, length);
if(utf8_to_enc(string,"UTF-16",length,(char **)&utf16) != UTF8_CONVERT_OK) return 0;
outf16 = utf16;
- if(!(ofont = ami_open_outline_font(fstyle))) return 0;
+ if(!(ofont = ami_open_outline_font(fstyle, FALSE))) return 0;
if(rp) SetRPAttrs(rp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,fstyle->foreground),TAG_DONE);
- dy++;
-
- for(i=0;i<=len;i++)
+ while(*utf16 != 0)
{
if (*utf16 < 0xD800 || 0xDFFF < *utf16)
utf16charlen = 1;
@@ -357,47 +424,31 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const
utf16next = utf16[utf16charlen];
- if(ESetInfo(&ofont->olf_EEngine,
- OT_GlyphCode, *utf16,
- OT_GlyphCode2, utf16next,
- TAG_END) == OTERR_Success)
+ tempx = ami_font_plot_glyph(ofont, rp, *utf16, utf16next, dx + x, dy, emwidth);
+
+ if(tempx == 0)
{
- if(EObtainInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,&glyph,
- TAG_END) == 0)
+ if(ufont == NULL)
+ {
+ ufont = ami_open_outline_font(fstyle, TRUE);
+ }
+
+ if(ufont)
+ {
+ tempx = ami_font_plot_glyph(ufont, rp, *utf16, utf16next,
+ dx + x, dy, emwidth);
+ }
+/*
+ if(tempx == 0)
{
- glyphbm = glyph->glm_BitMap;
- if(!glyphbm) continue;
-
- if(rp)
- {
- BltBitMapTags(BLITA_SrcX,glyph->glm_BlackLeft,
- BLITA_SrcY,glyph->glm_BlackTop,
- BLITA_DestX,dx + x - glyph->glm_X0 + glyph->glm_BlackLeft,
- BLITA_DestY,dy - glyph->glm_Y0 + glyph->glm_BlackTop,
- BLITA_Width,glyph->glm_BlackWidth,
- BLITA_Height,glyph->glm_BlackHeight,
- BLITA_Source,glyphbm,
- BLITA_SrcType,BLITT_ALPHATEMPLATE,
- BLITA_Dest,rp,
- BLITA_DestType,BLITT_RASTPORT,
- BLITA_SrcBytesPerRow,glyph->glm_BMModulo,
- TAG_DONE);
- }
-
- kern = 0;
-
- if(utf16next) EObtainInfo(&ofont->olf_EEngine,
- OT_TextKernPair, &kern,
- TAG_END);
-
- x += (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
-
- EReleaseInfo(&ofont->olf_EEngine,
- OT_GlyphMap8Bit,glyph,
- TAG_END);
+ tempx = ami_font_plot_glyph(ofont, rp, 0xfffd, utf16next,
+ dx + x, dy, emwidth);
}
+*/
}
+
+ x += tempx;
+
utf16 += utf16charlen;
}
@@ -438,8 +489,9 @@ void ami_init_fonts(void)
of[PLOT_FONT_FAMILY_MONOSPACE] = OpenOutlineFont(option_font_mono,NULL,OFF_OPEN);
of[PLOT_FONT_FAMILY_CURSIVE] = OpenOutlineFont(option_font_cursive,NULL,OFF_OPEN);
of[PLOT_FONT_FAMILY_FANTASY] = OpenOutlineFont(option_font_fantasy,NULL,OFF_OPEN);
+ of[NSA_UNICODE_FONT] = OpenOutlineFont(option_font_unicode,NULL,OFF_OPEN);
- for(i=PLOT_FONT_FAMILY_SANS_SERIF;i<=PLOT_FONT_FAMILY_FANTASY;i++)
+ for(i=PLOT_FONT_FAMILY_SANS_SERIF;i<=NSA_UNICODE_FONT;i++)
{
if(!of[i])
{
@@ -461,6 +513,9 @@ void ami_init_fonts(void)
case PLOT_FONT_FAMILY_FANTASY:
tmpfontname = option_font_fantasy;
break;
+ case NSA_UNICODE_FONT:
+ tmpfontname = option_font_unicode;
+ break;
default:
/* should never get here, but just in case */
tmpfontname = strdup("{unknown font}");
@@ -503,7 +558,7 @@ void ami_close_fonts(void)
{
int i=0;
- for(i=PLOT_FONT_FAMILY_SANS_SERIF;i<=PLOT_FONT_FAMILY_FANTASY;i++)
+ for(i=PLOT_FONT_FAMILY_SANS_SERIF;i<=NSA_UNICODE_FONT;i++)
{
if(of[i]) CloseOutlineFont(of[i],NULL);
if(ofb[i]) CloseOutlineFont(ofb[i],NULL);
diff --git a/amiga/gui.c b/amiga/gui.c
index 47aee25e7..cf47ebc5e 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -299,6 +299,7 @@ void ami_open_resources(void)
void ami_set_options(void)
{
STRPTR tempacceptlangs;
+ BPTR lock = 0;
/* The following line disables the popupmenu.class select menu
** This will become a user option when/if popupmenu.class is
@@ -364,6 +365,23 @@ void ami_set_options(void)
if((!option_font_fantasy) || (option_font_fantasy[0] == '\0'))
option_font_fantasy = (char *)strdup("DejaVu Serif");
+ if((!option_font_unicode) || (option_font_unicode[0] == '\0'))
+ {
+ /* Search for some likely candidates */
+
+ if(lock=Lock("FONTS:Code2000.font",ACCESS_READ))
+ {
+ UnLock(lock);
+ option_font_unicode = (char *)strdup("Code2000");
+ }
+ else if(lock=Lock("FONTS:Bitstream Cyberbit.font",ACCESS_READ))
+ {
+ UnLock(lock);
+ option_font_unicode = (char *)strdup("Bitstream Cyberbit");
+ }
+ else option_font_unicode = (char *)strdup("Deja Vu Sans");
+ }
+
if((!option_theme) || (option_theme[0] == '\0'))
option_theme = (char *)strdup("PROGDIR:Resources/Themes/Default");
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 128496caa..59f5803f7 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -97,6 +97,7 @@ enum
GID_OPTS_FONT_MONO,
GID_OPTS_FONT_CURSIVE,
GID_OPTS_FONT_FANTASY,
+ GID_OPTS_FONT_UNICODE,
GID_OPTS_FONT_DEFAULT,
GID_OPTS_FONT_SIZE,
GID_OPTS_FONT_MINSIZE,
@@ -259,6 +260,7 @@ void ami_gui_opts_setup(void)
gadlab[GID_OPTS_FONT_MONO] = (char *)ami_utf8_easy((char *)messages_get("FontMono"));
gadlab[GID_OPTS_FONT_CURSIVE] = (char *)ami_utf8_easy((char *)messages_get("FontCursive"));
gadlab[GID_OPTS_FONT_FANTASY] = (char *)ami_utf8_easy((char *)messages_get("FontFantasy"));
+ gadlab[GID_OPTS_FONT_UNICODE] = (char *)ami_utf8_easy((char *)messages_get("FontFallback"));
gadlab[GID_OPTS_FONT_DEFAULT] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_SIZE] = (char *)ami_utf8_easy((char *)messages_get("Default"));
gadlab[GID_OPTS_FONT_MINSIZE] = (char *)ami_utf8_easy((char *)messages_get("Minimum"));
@@ -367,7 +369,7 @@ void ami_gui_opts_open(void)
BOOL scaleselected = option_scale_quality, scaledisabled = FALSE;
BOOL download_notify_disabled = FALSE;
char animspeed[10];
- struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy;
+ struct TextAttr fontsans, fontserif, fontmono, fontcursive, fontfantasy, fontunicode;
if(option_use_pubscreen && option_use_pubscreen[0] != '\0')
{
@@ -438,24 +440,28 @@ void ami_gui_opts_open(void)
fontmono.ta_Name = ASPrintf("%s.font",option_font_mono);
fontcursive.ta_Name = ASPrintf("%s.font",option_font_cursive);
fontfantasy.ta_Name = ASPrintf("%s.font",option_font_fantasy);
+ fontunicode.ta_Name = ASPrintf("%s.font",option_font_unicode);
fontsans.ta_Style = 0;
fontserif.ta_Style = 0;
fontmono.ta_Style = 0;
fontcursive.ta_Style = 0;
fontfantasy.ta_Style = 0;
+ fontunicode.ta_Style = 0;
fontsans.ta_YSize = 0;
fontserif.ta_YSize = 0;
fontmono.ta_YSize = 0;
fontcursive.ta_YSize = 0;
fontfantasy.ta_YSize = 0;
+ fontunicode.ta_YSize = 0;
fontsans.ta_Flags = 0;
fontserif.ta_Flags = 0;
fontmono.ta_Flags = 0;
fontcursive.ta_Flags = 0;
fontfantasy.ta_Flags = 0;
+ fontunicode.ta_Flags = 0;
if(!gow)
{
@@ -894,6 +900,15 @@ void ami_gui_opts_open(void)
CHILD_Label, LabelObject,
LABEL_Text, gadlab[GID_OPTS_FONT_FANTASY],
LabelEnd,
+ LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_UNICODE] = GetFontObject,
+ GA_ID, GID_OPTS_FONT_UNICODE,
+ GA_RelVerify, TRUE,
+ GETFONT_TextAttr, &fontunicode,
+ GETFONT_OTagOnly, TRUE,
+ GetFontEnd,
+ CHILD_Label, LabelObject,
+ LABEL_Text, gadlab[GID_OPTS_FONT_UNICODE],
+ LabelEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_FONT_DEFAULT] = ChooserObject,
GA_ID, GID_OPTS_FONT_DEFAULT,
GA_RelVerify, TRUE,
@@ -1473,6 +1488,12 @@ void ami_gui_opts_use(void)
if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
option_font_fantasy = (char *)strdup((char *)tattr->ta_Name);
+ GetAttr(GETFONT_TextAttr,gow->objects[GID_OPTS_FONT_UNICODE],(ULONG *)&data);
+ tattr = (struct TextAttr *)data;
+ if(option_font_unicode) free(option_font_unicode);
+ if(dot = strrchr(tattr->ta_Name,'.')) *dot = '\0';
+ option_font_unicode = (char *)strdup((char *)tattr->ta_Name);
+
GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_FONT_DEFAULT],(ULONG *)&option_font_default);
option_font_default += PLOT_FONT_FAMILY_SANS_SERIF;
@@ -1741,6 +1762,11 @@ BOOL ami_gui_opts_event(void)
GFONT_REQUEST,gow->win);
break;
+ case GID_OPTS_FONT_UNICODE:
+ IDoMethod(gow->objects[GID_OPTS_FONT_UNICODE],
+ GFONT_REQUEST,gow->win);
+ break;
+
case GID_OPTS_DLDIR:
IDoMethod(gow->objects[GID_OPTS_DLDIR],
GFILE_REQUEST,gow->win);
diff --git a/amiga/options.h b/amiga/options.h
index 70963ba64..4d2e0fdca 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -48,6 +48,7 @@ extern int option_print_scale;
extern bool option_startup_no_window;
extern bool option_close_no_quit;
extern bool option_hide_docky_icon;
+extern char *option_font_unicode;
#define EXTRA_OPTION_DEFINE \
char *option_url_file = 0; \
@@ -78,6 +79,7 @@ int option_print_scale = 100; \
bool option_startup_no_window = false; \
bool option_close_no_quit = false; \
bool option_hide_docky_icon = false; \
+char *option_font_unicode = 0; \
#define EXTRA_OPTION_TABLE \
{ "url_file", OPTION_STRING, &option_url_file }, \
@@ -107,5 +109,6 @@ bool option_hide_docky_icon = false; \
{ "print_scale", OPTION_INTEGER, &option_print_scale}, \
{ "startup_no_window", OPTION_BOOL, &option_startup_no_window}, \
{ "close_no_quit", OPTION_BOOL, &option_close_no_quit}, \
-{ "hide_docky_icon", OPTION_BOOL, &option_hide_docky_icon},
+{ "hide_docky_icon", OPTION_BOOL, &option_hide_docky_icon}, \
+{ "font_unicode", OPTION_STRING, &option_font_unicode },
#endif