2024-03-29 09:17 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002477NetSurfRISC OS-specificpublic2018-08-29 14:00
ReporterSprow 
Assigned To 
SeveritymajorReproducibilityalways 
StatusclosedResolutionfixed 
Product Version3.5 
Target Version3.8Fixed in Version3.8 
Summary0002477: Scanning fonts fails on MathPhys despite previously being OK
DescriptionHaving not consciously changed my fonts (I only have 11 plus the ROM fonts) on my Risc PC, NetSurf now fails to start while scanning fonts. Perhaps I deleted the RUFL cache in !Scrap at some point, never mind.

I noticed this a while ago, but just moved the fonts out of the way to continue to use NetSurf, however with CI#3729 and putting the fonts back it's still there.

The rufl_test app seems happy with everything, and rufl_chars also. Dump attached from rufl_test in case that helps?
Steps To ReproduceRun NetSurf.
Additional InformationIt's also annoying that the Wimp's single tasking error box "The Unicode font library could not be initialized" opens centrally on screen and doesn't mention the font which was the problem, because it obscures the "Scanning fonts..." dialogue so you have to binary chop your !Fonts directory to find which one was the problem.
TagsNo tags attached.
Fixed in CI build #4305
Reported in CI build #3729
URL of problem page
Attached Files
  • zip file icon dump.zip (5,353 bytes) 2016-10-09 19:31
  • txt file icon Log_from4303.txt (5,705 bytes) 2018-01-21 15:58 -
    (0.000000) utils/log.c:263 nslog_init: NetSurf version '3.8 (Dev CI #4303)'
    (0.040000) utils/log.c:274 nslog_init: NetSurf on <RISC OS>, node <Email.WORKGROUP>, release <4.02>, version <19990818-001>, machine <armv4l>
    (0.050000) utils/nsoption.c:659 nsoption_read: Successfully opened 'NetSurf:Choices' for Options file
    (0.060000) utils/messages.c:212 messages_add_from_file: Loading Messages from 'NetSurf:Resources.en.Messages'
    (0.120000) frontends/riscos/gui.c:2447 get_cachepath: cachedir was null
    (0.130000) content/handlers/image/image_cache.c:432 image_cache_init: Image cache initialised with a limit of 550502 hysteresis of 110100
    (0.130000) render/html_css_fetcher.c:65 html_css_fetcher_initialise: html_css_fetcher_initialise called for x-ns-css
    (0.130000) content/fetchers/curl.c:1444 fetch_curl_register: curl_version libcurl/7.54.1 OpenSSL/1.1.0f zlib/1.2.11 c-ares/1.13.0
    (0.180000) utils/useragent.c:69 user_agent_build_string: Built user agent "NetSurf/3.8 (RISC OS)"
    (0.180000) content/fetchers/curl.c:1515 fetch_curl_register: ca_bundle: 'NetSurf:Resources.ca-bundle'
    (0.190000) content/fetchers/curl.c:1532 fetch_curl_register: cURL linked against openssl
    (0.190000) content/fetchers/curl.c:159 fetch_curl_initialise: Initialise cURL fetcher for http
    (0.190000) content/fetchers/curl.c:159 fetch_curl_initialise: Initialise cURL fetcher for https
    (0.190000) content/fetchers/data.c:61 fetch_data_initialise: fetch_data_initialise called for data
    (0.200000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for adblock.css
    (0.210000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for default.css
    (0.220000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for internal.css
    (0.230000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for quirks.css
    (0.230000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for user.css
    (0.240000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for credits.html
    (0.260000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for licence.html
    (0.270000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for welcome.html
    (0.280000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for maps.html
    (0.280000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for favicon.ico
    (0.290000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for default.ico
    (0.300000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for netsurf.png
    (0.320000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/arrow-l.png
    (0.330000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/content.png
    (0.340000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/directory.png
    (0.350000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/directory2.png
    (0.360000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/hotlist-add.png
    (0.370000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/hotlist-rmv.png
    (0.380000) content/fetchers/resource.c:288 fetch_resource_initialise: redirect url for icons/search.png
    (0.380000) content/llcache.c:3364 llcache_initialise: llcache initialising with a limit of 1651507 bytes
    (0.380000) utils/messages.c:212 messages_add_from_file: Loading Messages from 'NetSurf:Resources.LangNames'
    (0.490000) utils/filename.c:186 filename_initialise: Creating "<Wimp$ScrapDir>"
    (0.500000) utils/filename.c:186 filename_initialise: Creating "<Wimp$ScrapDir>/WWW"
    (0.500000) utils/filename.c:186 filename_initialise: Creating "<Wimp$ScrapDir>/WWW/NetSurf"
    (0.500000) utils/filename.c:200 filename_initialise: Temporary directory location: <Wimp$ScrapDir>/WWW/NetSurf/Misc
    (0.620000) frontends/riscos/font.c:123 nsfont_init: Initialise RUfl
    (0.000000s) src/rufl_init.c rufl_init 156: old font manager
    (0.000000s) src/rufl_init.c rufl_init 177: 36 faces, 18 families
    (0.000000s) src/rufl_init.c rufl_load_cache 1294: fopen: 0x2: No such file or directory
    (0.000000s) src/rufl_init.c rufl_init 193: scanning 0 "Corpus.Bold"
    (0.000000s) src/rufl_init.c rufl_init 193: scanning 1 "Corpus.Bold.Oblique"
    (0.000000s) src/rufl_init.c rufl_init 193: scanning 2 "Corpus.Medium"
    (0.000000s) src/rufl_init.c rufl_init 193: scanning 3 "Corpus.Medium.Oblique"
    (1.000000s) src/rufl_init.c rufl_init 193: scanning 4 "DPDings"
    (1.000000s) src/rufl_init.c rufl_init 193: scanning 5 "Homerton.Bold"
    (1.000000s) src/rufl_init.c rufl_init 193: scanning 6 "Homerton.Bold.Oblique"
    (1.000000s) src/rufl_init.c rufl_init 193: scanning 7 "Homerton.Medium"
    (1.000000s) src/rufl_init.c rufl_init 193: scanning 8 "Homerton.Medium.Oblique"
    (2.000000s) src/rufl_init.c rufl_init 193: scanning 9 "MathPhys"
    (2.000000s) src/rufl_init.c rufl_init 193: scanning 10 "MathPhys.Italic"
    (2.000000s) src/rufl_init.c rufl_init_scan_font_in_encoding 978: xfont_scan_string("MathPhys.Italic\ELatin1", U+20, ...): 0x21e: /Default encoding not found
    (2.000000s) src/rufl_init.c rufl_init_scan_font_old 793: rufl_init_scan_font_in_encoding("MathPhys.Italic", "Latin1", ...): 0x2 (0x21e: /Default encoding not found)
    (2.000000s) src/rufl_init.c rufl_init 204: rufl_init_scan_font: 0x2
    (2.820000) frontends/riscos/font.c:130 nsfont_init: rufl_init: rufl_FONT_MANAGER_ERROR: 0x21e: /Default encoding not found
    (2.820000) frontends/riscos/gui.c:2156 die: The Unicode font library could not be initialized. Please report this to the developers.
    
    txt file icon Log_from4303.txt (5,705 bytes) 2018-01-21 15:58 +

-Relationships
+Relationships

-Notes
Sprow

~0001411

Sprow (reporter)

Spotted this in the log:

(0.640000) frontends/riscos/font.c:120 nsfont_init: Initialise RUfl
(2.180000) frontends/riscos/font.c:124 nsfont_init: rufl_init: rufl_FONT_MANAGER_ERROR: 0x21e: /Default encoding not found
(2.180000) frontends/riscos/gui.c:2124 die: The Unicode font library could not be initialized. Please report this to the developers.
Sprow

~0001414

Sprow (reporter)

Extra data point, since this is a Risc PC, if I softload RISC OS 5 NetSurf starts correctly (ie. with the same !Fonts) but with RISC OS 4.02 the above error happens. Presumably some difference in behaviour between the two font managers?
Vincent Sanders

~0001442

Vincent Sanders (administrator)

Unfortunately as this is a RISC OS specific issue and we currently have no active RISC OS developer we cannot guarantee a timely response to this issue.
Sprow

~0001538

Sprow (reporter)

Just tried this again with 3.7 CI#4060, but it still errors.
Having had a quick look at rufl_init() there are only 11 places where it can return rufl_FONT_MANAGER_ERROR.

I think the key piece of information (which I don't appear to have mentioned before, sorry) is that it's Font Manager 3.71. This seems to be key. If I go back to the ROM based Font Manager (3.40) then the RUFL cache is generated. I can then reboot so I'm back with Font Manager 3.71 again and the cache is loaded OK.

I can see in rufl_init.c there's all kinds of logic to work out which API to use. It would seem the non-unicode case is tripping up requesting the /Default encoding for some reason, which is presumably skipped entirely on old font managers.
John-Mark Bell

~0001713

John-Mark Bell (administrator)

Please try again with CI build 4300 or later, and attach the log file. Thanks.
Sprow

~0001717

Sprow (reporter)

Updated log attached (from CI #4303 as it happens).
John-Mark Bell

~0001719

John-Mark Bell (administrator)

OK, so xfont_find_font("MathPhys.Italic\ELatin1", 160, 160, 0, 0, &font, 0, 0) succeeds and returns a font handle.

However, calling xfont_scan_string(font, " ", font_RETURN_BBOX | font_GIVEN_FONT | font_GIVEN_LENGTH | font_GIVEN_BLOCK, 0x7fffffff, 0x7fffffff, &block, 0, 1, 0, &x_out, &y_out, 0) fails as the /Default encoding can't be found.

I don't happen to have MathPhys.Italic to hand, but I expect it's a symbol font (i.e. has Outlines and IntMetrics files, rather than IntMetric<N> and has no Encoding file of its own). With the Unicode FontManager (which you appear to be softloading, this causes the FontManager to attempt to load the /Default encoding from Font:Encodings./Default. This is present in the ROMFonts module on RISC OS 5. I suspect, however, it's not present in the RISC OS 4 ROMFonts module (and I also expect that you're not softloading the RISC OS 5 ROMFonts module).

So, you probably want to stick https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Video/Render/Fonts/ROMFonts/Fonts/Encodings/_Default?rev=1.1;content-type=text%2Fplain;hideattic=0 in !Fonts.Encodings (or softload the RISC OS 5 ROMFonts module).

We can probably make RUfl ignore this font completely in the case where the encoding can't be loaded, but that's a sticking plaster, not a fix.
John-Mark Bell

~0001720

John-Mark Bell (administrator)

If you can test with 4304 or later and post the log file, that'll help. It should probably work "fine", as I've made it ignore the lack of encoding file when attempting to read the font.
John-Mark Bell

~0001723

John-Mark Bell (administrator)

Actually, make that 4305 or later -- 4304 only covered half the wound.
Sprow

~0001724

Sprow (reporter)

You're right MathPhys is a symbol font, it comprises 5 files
  MathPhys.Encoding MathPhys.IntMetrics MathPhys.Outlines
  MathPhys.Italic.IntMetrics MathPhys.Italic.Outlines
and comes as part of TechWriter. You're right there's no /Default in my Encodings directory.

I notice NetSurf adds to Font$Path so I was able to get rid of the error with CI #4303 by just putting an Encodings./Default alongside the NSSymbol inside !NetSurf.Resources.

I also tried CI #4305 (having removed the /Default file) and that also got rid of the error - success!

So it seems there's two ways out:
a) add a Encodings./Default
b) swallow the error in RUfl
John-Mark Bell

~0001726

John-Mark Bell (administrator)

Thanks.

The underlying issue here is that you're attempting to use a Unicode-capable FontManager without a corresponding ROMFonts module.

When non-Unicode-capable FontManagers deal with symbol fonts, they will use the Encoding file in the font directory, if present, or default to assuming a 1:1 mapping between glyph index and codepoint. The Unicode FontManager behaves differently in the latter case: it relies on there being a /Default encoding to map between glyph index and codepoint (full details can be found in $2.3 of https://www.riscosopen.org/wiki/documentation/show/UCS%20Font%20Manager)

It is also worth noting that RUfl decides that the FontManager in this case is not Unicode-capable. The reason for this is that the test it uses to determine Unicode-awareness is to call XFont_FindFont with "Homerton.Medium\EUTF8" -- if this fails, then it decides it's dealing with a non-Unicode-capable FontManager. For this test to work, the Unicode FontManager requires the presence of a UTF8 encoding file. This is found in the ROMFonts module, too, so is also missing here.

We're not going to add these encoding files to the NetSurf distribution as they belong to the FontManager/ROMFonts combination -- they're not specific to NetSurf (or RUfl), and we assume that OS components are installed correctly. While I've made RUfl more tolerant of mismatched FontManager/ROMFonts, it's not a real fix (as the net effect is that all symbol fonts with no explicit Encoding file will be ignored).
Sprow

~0001728

Sprow (reporter)

I think the extra robustness in RUfl will catch casual FontManager soft loaders (it's been long enough that I've now forgotten why I was softloading it on the Risc PC, probably something for !Pluto email) from falling, and I can add an updated ROMFonts to do it properly.

Thanks for investigating. Good to close.
Vincent Sanders

~0001831

Vincent Sanders (administrator)

Thank you for your report, this has been resolved in the 3.8 release
+Notes

-Issue History
Date Modified Username Field Change
2016-10-09 19:31 Sprow New Issue
2016-10-09 19:31 Sprow File Added: dump.zip
2016-10-09 19:58 Sprow Note Added: 0001411
2016-10-27 19:37 Sprow Note Added: 0001414
2016-11-22 22:21 Vincent Sanders Note Added: 0001442
2016-11-22 22:21 Vincent Sanders Status new => acknowledged
2017-04-11 15:54 Sprow Note Added: 0001538
2018-01-21 12:11 John-Mark Bell Note Added: 0001713
2018-01-21 12:30 John-Mark Bell Status acknowledged => feedback
2018-01-21 15:58 Sprow File Added: Log_from4303.txt
2018-01-21 16:06 Sprow Note Added: 0001717
2018-01-21 16:06 Sprow Status feedback => new
2018-01-21 17:28 John-Mark Bell Note Added: 0001719
2018-01-21 17:38 John-Mark Bell Note Added: 0001720
2018-01-21 17:42 John-Mark Bell Status new => feedback
2018-01-21 19:29 John-Mark Bell Note Added: 0001723
2018-01-21 21:21 Sprow Note Added: 0001724
2018-01-21 21:21 Sprow Status feedback => new
2018-01-22 01:02 John-Mark Bell Note Added: 0001726
2018-01-22 08:41 Sprow Note Added: 0001728
2018-01-22 10:32 John-Mark Bell Status new => resolved
2018-01-22 10:32 John-Mark Bell Resolution open => fixed
2018-01-22 10:32 John-Mark Bell Fixed in Version => 3.8
2018-01-22 10:32 John-Mark Bell Target Version => 3.8
2018-01-22 10:32 John-Mark Bell Fixed in CI build # => 4305
2018-08-29 14:00 Vincent Sanders Status resolved => closed
2018-08-29 14:00 Vincent Sanders Note Added: 0001831
+Issue History