Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/c38670ade8c664fa511ce...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/c38670ade8c664fa511cebb...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/c38670ade8c664fa511cebb4b...
The branch, master has been updated
via c38670ade8c664fa511cebb4b5d2950b12e7bf81 (commit)
via 8282f53880877f84b1fce05c5529e8994abcb690 (commit)
via bc3534d920f07bd30ca9281ea7f2ea3aa0767901 (commit)
from 7459d4dc93f449ad8fcf98e5fd5e0f33d857703d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c38670ade8c664fa511...
commit c38670ade8c664fa511cebb4b5d2950b12e7bf81
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Allow a fallback font for characters above 0xFFFF to be specified. There is no
scanning of this range as most fonts don't have any characters here. Symbola is
selected if it is installed.
diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide
index 2ea772e..aecdb18 100755
--- a/amiga/dist/NetSurf.guide
+++ b/amiga/dist/NetSurf.guide
@@ -153,6 +153,8 @@ Additional fall-back fonts can be provided since NetSurf 3.0. These
need to go i
NB: Since NetSurf 3.0, NetSurf will scan the provided Unicode fonts, and the rest of the
system fonts, on first startup. Setting font_unicode_only:1 will prevent fonts not in the
preferred Unicode fonts list from being scanned or used as fallback fonts. If the system
fonts or NetSurf's fallback fonts list changes, this cache will need to be
re-generated. This can be forced by deleting the font glyph cache (which defaults to
Users/user/FontGlyphCache).
+Since NetSurf 3.4, Unicode glyphs above 0xFFFF are supported. These are mainly used for
Emoji. The option to specify a fallback font for this range is font_surrogate - there is
no scanning of system fonts. If @{"Symbola" rxs "address netsurf 'open
http://users.teilar.gr/~g1951d/'"} font is installed it will be selected
automatically.
+
@{b}Font sizes@{ub}
The default and minimum font sizes can also be set.
diff --git a/amiga/font.c b/amiga/font.c
index 12375ad..c39b002 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -162,7 +162,7 @@ static void ami_font_cleanup(struct MinList *ami_font_list);
static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
-static inline int amiga_nsfont_utf16_char_length(uint16 *char1)
+static inline int amiga_nsfont_utf16_char_length(const uint16 *char1)
{
if (__builtin_expect(((*char1 < 0xD800) || (0xDBFF < *char1)), 1)) {
return 1;
@@ -461,7 +461,12 @@ static struct OutlineFont *ami_open_outline_font(const
plot_font_style_t *fstyle
break;
case NSA_UNICODE_FONT:
default:
- fontname = (char *)ami_font_scan_lookup(codepoint, glypharray);
+ if(__builtin_expect((amiga_nsfont_utf16_char_length(codepoint) == 2), 0)) {
+ /* Multi-byte character */
+ fontname = nsoption_charp(font_surrogate);
+ } else {
+ fontname = (char *)ami_font_scan_lookup(codepoint, glypharray);
+ }
if(fontname == NULL) return NULL;
break;
}
@@ -604,6 +609,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
long_char_1 = amiga_nsfont_decode_surrogate(char1);
long_char_2 = amiga_nsfont_decode_surrogate(char2);
+ /**\todo use OT_GlyphCode_32 so we get an error for old font engines */
if(ESetInfo(AMI_OFONT_ENGINE,
OT_GlyphCode, long_char_1,
@@ -690,6 +696,7 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
if (*char2 < 0x0020) skip_c2 = true;
long_char_1 = amiga_nsfont_decode_surrogate(char1);
+ /**\todo use OT_GlyphCode_32 so we get an error for old font engines */
if(ESetInfo(AMI_OFONT_ENGINE,
OT_GlyphCode, long_char_1,
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index 930a150..4f4b774 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -254,7 +254,12 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string
**glypharray)
}
#ifdef __amigaos4__
if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) {
- if(unicoderanges & UCR_SURROGATES) LOG("%s supports UTF-16 surrogates",
fontname);
+ if(unicoderanges & UCR_SURROGATES) {
+ LOG("%s supports UTF-16 surrogates", fontname);
+ if (nsoption_charp(font_surrogate) == NULL) {
+ nsoption_set_charp(font_surrogate, (char *)strdup(fontname));
+ }
+ }
EReleaseInfo(AMI_OFONT_ENGINE,
OT_UnicodeRanges, unicoderanges,
TAG_END);
diff --git a/amiga/gui.c b/amiga/gui.c
index 1eb561d..b7f3285 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -604,13 +604,13 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.font", ACCESS_READ)))
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
}
- else if((lock = Lock("FONTS:Bitstream Cyberbit.font", ACCESS_READ)))
+ else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
@@ -618,6 +618,19 @@ static nserror ami_set_options(struct nsoption_s *defaults)
}
}
+ if (nsoption_charp(font_surrogate) == NULL) {
+ BPTR lock = 0;
+ /* Search for some likely candidates -
+ * Ideally we should pick a font during the scan process which announces it
+ * contains UCR_SURROGATES, but nothing appears to have the tag.
+ */
+ if((lock = Lock("FONTS:Symbola.otag", ACCESS_READ))) {
+ UnLock(lock);
+ nsoption_set_charp(font_surrogate,
+ (char *)strdup("Symbola"));
+ }
+ }
+
if(popupmenu_lib_ok == FALSE)
nsoption_set_bool(context_menu, false);
diff --git a/amiga/options.h b/amiga/options.h
index b942420..a98b1e8 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -60,6 +60,7 @@ NSOPTION_BOOL(startup_no_window, false)
NSOPTION_BOOL(close_no_quit, false)
NSOPTION_BOOL(hide_docky_icon, false)
NSOPTION_STRING(font_unicode, NULL)
+NSOPTION_STRING(font_surrogate, NULL)
NSOPTION_STRING(font_unicode_file, NULL)
NSOPTION_BOOL(font_unicode_only, false)
NSOPTION_BOOL(font_antialiasing, true)
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8282f53880877f84b1f...
commit 8282f53880877f84b1fce05c5529e8994abcb690
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Support UTF-16 surrogates. This enables Emoji to be displayed if an appropriate font
is installed.
NB: Currently surrogate glyphs are not able to use the fallback font. The wrong
glyphs may be displayed if you use an "old font engine".
diff --git a/amiga/font.c b/amiga/font.c
index e32049f..12375ad 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -171,6 +171,15 @@ static inline int amiga_nsfont_utf16_char_length(uint16 *char1)
}
}
+static inline uint32 amiga_nsfont_decode_surrogate(const uint16 *char1)
+{
+ if(__builtin_expect((amiga_nsfont_utf16_char_length(char1) == 2), 0)) {
+ return ((uint32)char1[0] << 10) + char1[1] - 0x35FDC00;
+ } else {
+ return (uint32)*char1;
+ }
+}
+
static inline bool amiga_nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
@@ -564,10 +573,12 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
FIXED kern = 0;
ULONG glyphmaptag;
ULONG template_type;
+ uint32 long_char_1 = 0, long_char_2 = 0;
#ifndef __amigaos4__
struct BulletBase *BulletBase = ofont->BulletBase;
#endif
+#ifndef __amigaos4__
if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) {
/* We don't support UTF-16 surrogates yet, so just return. */
return 0;
@@ -577,6 +588,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
/* Don't attempt to kern a UTF-16 surrogate */
*char2 = 0;
}
+#endif
if(aa == true) {
#ifdef __amigaos4__
@@ -590,9 +602,12 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
#endif
}
+ long_char_1 = amiga_nsfont_decode_surrogate(char1);
+ long_char_2 = amiga_nsfont_decode_surrogate(char2);
+
if(ESetInfo(AMI_OFONT_ENGINE,
- OT_GlyphCode, *char1,
- OT_GlyphCode2, *char2,
+ OT_GlyphCode, long_char_1,
+ OT_GlyphCode2, long_char_2,
TAG_END) == OTERR_Success)
{
if(EObtainInfo(AMI_OFONT_ENGINE,
@@ -655,10 +670,12 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
FIXED char1w = 0;
struct GlyphWidthEntry *gwnode;
bool skip_c2 = false;
+ uint32 long_char_1 = 0;
#ifndef __amigaos4__
struct BulletBase *BulletBase = ofont->BulletBase;
#endif
+#ifndef __amigaos4__
if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) {
/* We don't support UTF-16 surrogates yet, so just return. */
return 0;
@@ -668,14 +685,15 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
/* Don't attempt to kern a UTF-16 surrogate */
skip_c2 = true;
}
-
-
+#endif
if (*char2 < 0x0020) skip_c2 = true;
+ long_char_1 = amiga_nsfont_decode_surrogate(char1);
+
if(ESetInfo(AMI_OFONT_ENGINE,
- OT_GlyphCode, *char1,
- OT_GlyphCode2, *char1,
+ OT_GlyphCode, long_char_1,
+ OT_GlyphCode2, long_char_1,
TAG_END) == OTERR_Success)
{
if(EObtainInfo(AMI_OFONT_ENGINE,
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=bc3534d920f07bd30ca...
commit bc3534d920f07bd30ca9281ea7f2ea3aa0767901
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Split UTF-16 char length check into a separate function
diff --git a/amiga/font.c b/amiga/font.c
index 6d5200f..e32049f 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -162,6 +162,15 @@ static void ami_font_cleanup(struct MinList *ami_font_list);
static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
+static inline int amiga_nsfont_utf16_char_length(uint16 *char1)
+{
+ if (__builtin_expect(((*char1 < 0xD800) || (0xDBFF < *char1)), 1)) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
+
static inline bool amiga_nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
@@ -206,11 +215,7 @@ static inline bool amiga_nsfont_position_in_string(const
plot_font_style_t *fsty
*actual_x = 0;
while (utf8_pos < length) {
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
tempx = ami_font_width_glyph(ofont, utf16, utf16next, emwidth);
@@ -664,6 +669,8 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
skip_c2 = true;
}
+
+
if (*char2 < 0x0020) skip_c2 = true;
if(ESetInfo(AMI_OFONT_ENGINE,
@@ -746,11 +753,7 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string,
ULONG lengt
while(*utf16 != 0)
{
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
if(fstyle->flags & FONTF_SMALLCAPS)
@@ -811,11 +814,7 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG
length,
while(*utf16 != 0)
{
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
if(fstyle->flags & FONTF_SMALLCAPS)
@@ -915,7 +914,7 @@ static void ami_font_cleanup(struct MinList *ami_font_list)
SubTime(&curtime, &fnode->lastused);
if(curtime.Seconds > 300)
{
- LOG("Freeing %s not used for %d seconds", node->dtz_Node.ln_Name,
curtime.Seconds);
+ LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name,
curtime.Seconds);
DelObject(node);
}
} while((node=nnode));
@@ -958,7 +957,7 @@ void ami_font_setdevicedpi(int id)
xdpi = (yres * ydpi) / xres;
- LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x
%ld)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres);
+ LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x
%d)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres);
}
}
}
-----------------------------------------------------------------------
Summary of changes:
amiga/dist/NetSurf.guide | 2 ++
amiga/font.c | 68 +++++++++++++++++++++++++++++++---------------
amiga/font_scan.c | 7 ++++-
amiga/gui.c | 17 ++++++++++--
amiga/options.h | 1 +
5 files changed, 70 insertions(+), 25 deletions(-)
diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide
index 2ea772e..aecdb18 100755
--- a/amiga/dist/NetSurf.guide
+++ b/amiga/dist/NetSurf.guide
@@ -153,6 +153,8 @@ Additional fall-back fonts can be provided since NetSurf 3.0. These
need to go i
NB: Since NetSurf 3.0, NetSurf will scan the provided Unicode fonts, and the rest of the
system fonts, on first startup. Setting font_unicode_only:1 will prevent fonts not in the
preferred Unicode fonts list from being scanned or used as fallback fonts. If the system
fonts or NetSurf's fallback fonts list changes, this cache will need to be
re-generated. This can be forced by deleting the font glyph cache (which defaults to
Users/user/FontGlyphCache).
+Since NetSurf 3.4, Unicode glyphs above 0xFFFF are supported. These are mainly used for
Emoji. The option to specify a fallback font for this range is font_surrogate - there is
no scanning of system fonts. If @{"Symbola" rxs "address netsurf 'open
http://users.teilar.gr/~g1951d/'"} font is installed it will be selected
automatically.
+
@{b}Font sizes@{ub}
The default and minimum font sizes can also be set.
diff --git a/amiga/font.c b/amiga/font.c
index 6d5200f..c39b002 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -162,6 +162,24 @@ static void ami_font_cleanup(struct MinList *ami_font_list);
static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa);
+static inline int amiga_nsfont_utf16_char_length(const uint16 *char1)
+{
+ if (__builtin_expect(((*char1 < 0xD800) || (0xDBFF < *char1)), 1)) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
+
+static inline uint32 amiga_nsfont_decode_surrogate(const uint16 *char1)
+{
+ if(__builtin_expect((amiga_nsfont_utf16_char_length(char1) == 2), 0)) {
+ return ((uint32)char1[0] << 10) + char1[1] - 0x35FDC00;
+ } else {
+ return (uint32)*char1;
+ }
+}
+
static inline bool amiga_nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
@@ -206,11 +224,7 @@ static inline bool amiga_nsfont_position_in_string(const
plot_font_style_t *fsty
*actual_x = 0;
while (utf8_pos < length) {
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
tempx = ami_font_width_glyph(ofont, utf16, utf16next, emwidth);
@@ -447,7 +461,12 @@ static struct OutlineFont *ami_open_outline_font(const
plot_font_style_t *fstyle
break;
case NSA_UNICODE_FONT:
default:
- fontname = (char *)ami_font_scan_lookup(codepoint, glypharray);
+ if(__builtin_expect((amiga_nsfont_utf16_char_length(codepoint) == 2), 0)) {
+ /* Multi-byte character */
+ fontname = nsoption_charp(font_surrogate);
+ } else {
+ fontname = (char *)ami_font_scan_lookup(codepoint, glypharray);
+ }
if(fontname == NULL) return NULL;
break;
}
@@ -559,10 +578,12 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
FIXED kern = 0;
ULONG glyphmaptag;
ULONG template_type;
+ uint32 long_char_1 = 0, long_char_2 = 0;
#ifndef __amigaos4__
struct BulletBase *BulletBase = ofont->BulletBase;
#endif
+#ifndef __amigaos4__
if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) {
/* We don't support UTF-16 surrogates yet, so just return. */
return 0;
@@ -572,6 +593,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
/* Don't attempt to kern a UTF-16 surrogate */
*char2 = 0;
}
+#endif
if(aa == true) {
#ifdef __amigaos4__
@@ -585,9 +607,13 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont,
struct RastPo
#endif
}
+ long_char_1 = amiga_nsfont_decode_surrogate(char1);
+ long_char_2 = amiga_nsfont_decode_surrogate(char2);
+ /**\todo use OT_GlyphCode_32 so we get an error for old font engines */
+
if(ESetInfo(AMI_OFONT_ENGINE,
- OT_GlyphCode, *char1,
- OT_GlyphCode2, *char2,
+ OT_GlyphCode, long_char_1,
+ OT_GlyphCode2, long_char_2,
TAG_END) == OTERR_Success)
{
if(EObtainInfo(AMI_OFONT_ENGINE,
@@ -650,10 +676,12 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
FIXED char1w = 0;
struct GlyphWidthEntry *gwnode;
bool skip_c2 = false;
+ uint32 long_char_1 = 0;
#ifndef __amigaos4__
struct BulletBase *BulletBase = ofont->BulletBase;
#endif
+#ifndef __amigaos4__
if (__builtin_expect(((*char1 >= 0xD800) && (*char1 <= 0xDBFF)), 0)) {
/* We don't support UTF-16 surrogates yet, so just return. */
return 0;
@@ -663,12 +691,16 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont,
/* Don't attempt to kern a UTF-16 surrogate */
skip_c2 = true;
}
+#endif
if (*char2 < 0x0020) skip_c2 = true;
+ long_char_1 = amiga_nsfont_decode_surrogate(char1);
+ /**\todo use OT_GlyphCode_32 so we get an error for old font engines */
+
if(ESetInfo(AMI_OFONT_ENGINE,
- OT_GlyphCode, *char1,
- OT_GlyphCode2, *char1,
+ OT_GlyphCode, long_char_1,
+ OT_GlyphCode2, long_char_1,
TAG_END) == OTERR_Success)
{
if(EObtainInfo(AMI_OFONT_ENGINE,
@@ -746,11 +778,7 @@ ULONG ami_font_unicode_text(struct RastPort *rp, const char *string,
ULONG lengt
while(*utf16 != 0)
{
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
if(fstyle->flags & FONTF_SMALLCAPS)
@@ -811,11 +839,7 @@ static inline ULONG ami_font_unicode_width(const char *string, ULONG
length,
while(*utf16 != 0)
{
- if ((*utf16 < 0xD800) || (0xDBFF < *utf16))
- utf16charlen = 1;
- else
- utf16charlen = 2;
-
+ utf16charlen = amiga_nsfont_utf16_char_length(utf16);
utf16next = &utf16[utf16charlen];
if(fstyle->flags & FONTF_SMALLCAPS)
@@ -915,7 +939,7 @@ static void ami_font_cleanup(struct MinList *ami_font_list)
SubTime(&curtime, &fnode->lastused);
if(curtime.Seconds > 300)
{
- LOG("Freeing %s not used for %d seconds", node->dtz_Node.ln_Name,
curtime.Seconds);
+ LOG("Freeing %s not used for %ld seconds", node->dtz_Node.ln_Name,
curtime.Seconds);
DelObject(node);
}
} while((node=nnode));
@@ -958,7 +982,7 @@ void ami_font_setdevicedpi(int id)
xdpi = (yres * ydpi) / xres;
- LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %ld x %ld, corrected %ld x
%ld)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres);
+ LOG("XDPI = %ld, YDPI = %ld (DisplayInfo resolution %d x %d, corrected %d x
%d)", xdpi, ydpi, dinfo.Resolution.x, dinfo.Resolution.y, xres, yres);
}
}
}
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index 930a150..4f4b774 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -254,7 +254,12 @@ static ULONG ami_font_scan_font(const char *fontname, lwc_string
**glypharray)
}
#ifdef __amigaos4__
if(EObtainInfo(AMI_OFONT_ENGINE, OT_UnicodeRanges, &unicoderanges, TAG_END) == 0) {
- if(unicoderanges & UCR_SURROGATES) LOG("%s supports UTF-16 surrogates",
fontname);
+ if(unicoderanges & UCR_SURROGATES) {
+ LOG("%s supports UTF-16 surrogates", fontname);
+ if (nsoption_charp(font_surrogate) == NULL) {
+ nsoption_set_charp(font_surrogate, (char *)strdup(fontname));
+ }
+ }
EReleaseInfo(AMI_OFONT_ENGINE,
OT_UnicodeRanges, unicoderanges,
TAG_END);
diff --git a/amiga/gui.c b/amiga/gui.c
index 1eb561d..b7f3285 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -604,13 +604,13 @@ static nserror ami_set_options(struct nsoption_s *defaults)
BPTR lock = 0;
/* Search for some likely candidates */
- if((lock = Lock("FONTS:Code2000.font", ACCESS_READ)))
+ if((lock = Lock("FONTS:Code2000.otag", ACCESS_READ)))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
}
- else if((lock = Lock("FONTS:Bitstream Cyberbit.font", ACCESS_READ)))
+ else if((lock = Lock("FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
@@ -618,6 +618,19 @@ static nserror ami_set_options(struct nsoption_s *defaults)
}
}
+ if (nsoption_charp(font_surrogate) == NULL) {
+ BPTR lock = 0;
+ /* Search for some likely candidates -
+ * Ideally we should pick a font during the scan process which announces it
+ * contains UCR_SURROGATES, but nothing appears to have the tag.
+ */
+ if((lock = Lock("FONTS:Symbola.otag", ACCESS_READ))) {
+ UnLock(lock);
+ nsoption_set_charp(font_surrogate,
+ (char *)strdup("Symbola"));
+ }
+ }
+
if(popupmenu_lib_ok == FALSE)
nsoption_set_bool(context_menu, false);
diff --git a/amiga/options.h b/amiga/options.h
index b942420..a98b1e8 100644
--- a/amiga/options.h
+++ b/amiga/options.h
@@ -60,6 +60,7 @@ NSOPTION_BOOL(startup_no_window, false)
NSOPTION_BOOL(close_no_quit, false)
NSOPTION_BOOL(hide_docky_icon, false)
NSOPTION_STRING(font_unicode, NULL)
+NSOPTION_STRING(font_surrogate, NULL)
NSOPTION_STRING(font_unicode_file, NULL)
NSOPTION_BOOL(font_unicode_only, false)
NSOPTION_BOOL(font_antialiasing, true)
--
NetSurf Browser